mirror of
https://github.com/hanzoai/runtime.git
synced 2026-10-30 18:23:13 +00:00
- Add main Dockerfile for production builds - Add Dockerfile.runtime for secure code execution - Add Dockerfile.runtime.fixed with improved configuration - Include .dockerignore for build optimization - Add integration documentation and publishing guides - Update API and CLI components for better runtime support - Enhance sandbox and container management features
18202 lines
713 KiB
Python
Generated
18202 lines
713 KiB
Python
Generated
# coding: utf-8
|
|
|
|
"""
|
|
Runtime
|
|
|
|
Runtime AI platform API Docs
|
|
|
|
The version of the OpenAPI document: 1.0
|
|
Contact: [email protected]
|
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
Do not edit the class manually.
|
|
""" # noqa: E501
|
|
|
|
import warnings
|
|
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
from typing_extensions import Annotated
|
|
|
|
from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr
|
|
from typing import List, Optional, Tuple, Union
|
|
from typing_extensions import Annotated
|
|
from runtime_api_client_async.models.command import Command
|
|
from runtime_api_client_async.models.completion_list import CompletionList
|
|
from runtime_api_client_async.models.compressed_screenshot_response import CompressedScreenshotResponse
|
|
from runtime_api_client_async.models.computer_use_start_response import ComputerUseStartResponse
|
|
from runtime_api_client_async.models.computer_use_status_response import ComputerUseStatusResponse
|
|
from runtime_api_client_async.models.computer_use_stop_response import ComputerUseStopResponse
|
|
from runtime_api_client_async.models.create_session_request import CreateSessionRequest
|
|
from runtime_api_client_async.models.display_info_response import DisplayInfoResponse
|
|
from runtime_api_client_async.models.execute_request import ExecuteRequest
|
|
from runtime_api_client_async.models.execute_response import ExecuteResponse
|
|
from runtime_api_client_async.models.file_info import FileInfo
|
|
from runtime_api_client_async.models.git_add_request import GitAddRequest
|
|
from runtime_api_client_async.models.git_branch_request import GitBranchRequest
|
|
from runtime_api_client_async.models.git_checkout_request import GitCheckoutRequest
|
|
from runtime_api_client_async.models.git_clone_request import GitCloneRequest
|
|
from runtime_api_client_async.models.git_commit_info import GitCommitInfo
|
|
from runtime_api_client_async.models.git_commit_request import GitCommitRequest
|
|
from runtime_api_client_async.models.git_commit_response import GitCommitResponse
|
|
from runtime_api_client_async.models.git_delete_branch_request import GitDeleteBranchRequest
|
|
from runtime_api_client_async.models.git_repo_request import GitRepoRequest
|
|
from runtime_api_client_async.models.git_status import GitStatus
|
|
from runtime_api_client_async.models.keyboard_hotkey_request import KeyboardHotkeyRequest
|
|
from runtime_api_client_async.models.keyboard_press_request import KeyboardPressRequest
|
|
from runtime_api_client_async.models.keyboard_type_request import KeyboardTypeRequest
|
|
from runtime_api_client_async.models.list_branch_response import ListBranchResponse
|
|
from runtime_api_client_async.models.lsp_completion_params import LspCompletionParams
|
|
from runtime_api_client_async.models.lsp_document_request import LspDocumentRequest
|
|
from runtime_api_client_async.models.lsp_server_request import LspServerRequest
|
|
from runtime_api_client_async.models.lsp_symbol import LspSymbol
|
|
from runtime_api_client_async.models.match import Match
|
|
from runtime_api_client_async.models.mouse_click_request import MouseClickRequest
|
|
from runtime_api_client_async.models.mouse_click_response import MouseClickResponse
|
|
from runtime_api_client_async.models.mouse_drag_request import MouseDragRequest
|
|
from runtime_api_client_async.models.mouse_drag_response import MouseDragResponse
|
|
from runtime_api_client_async.models.mouse_move_request import MouseMoveRequest
|
|
from runtime_api_client_async.models.mouse_move_response import MouseMoveResponse
|
|
from runtime_api_client_async.models.mouse_position import MousePosition
|
|
from runtime_api_client_async.models.mouse_scroll_request import MouseScrollRequest
|
|
from runtime_api_client_async.models.mouse_scroll_response import MouseScrollResponse
|
|
from runtime_api_client_async.models.process_errors_response import ProcessErrorsResponse
|
|
from runtime_api_client_async.models.process_logs_response import ProcessLogsResponse
|
|
from runtime_api_client_async.models.process_restart_response import ProcessRestartResponse
|
|
from runtime_api_client_async.models.process_status_response import ProcessStatusResponse
|
|
from runtime_api_client_async.models.project_dir_response import ProjectDirResponse
|
|
from runtime_api_client_async.models.region_screenshot_response import RegionScreenshotResponse
|
|
from runtime_api_client_async.models.replace_request import ReplaceRequest
|
|
from runtime_api_client_async.models.replace_result import ReplaceResult
|
|
from runtime_api_client_async.models.screenshot_response import ScreenshotResponse
|
|
from runtime_api_client_async.models.search_files_response import SearchFilesResponse
|
|
from runtime_api_client_async.models.session import Session
|
|
from runtime_api_client_async.models.session_execute_request import SessionExecuteRequest
|
|
from runtime_api_client_async.models.session_execute_response import SessionExecuteResponse
|
|
from runtime_api_client_async.models.windows_response import WindowsResponse
|
|
|
|
from runtime_api_client_async.api_client import ApiClient, RequestSerialized
|
|
from runtime_api_client_async.api_response import ApiResponse
|
|
from runtime_api_client_async.rest import RESTResponseType
|
|
|
|
|
|
class ToolboxApi:
|
|
"""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) -> None:
|
|
if api_client is None:
|
|
api_client = ApiClient.get_default()
|
|
self.api_client = api_client
|
|
|
|
|
|
@validate_call
|
|
async def click_mouse(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_click_request: MouseClickRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> MouseClickResponse:
|
|
"""Click mouse
|
|
|
|
Click mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_click_request: (required)
|
|
:type mouse_click_request: MouseClickRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._click_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_click_request=mouse_click_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseClickResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def click_mouse_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_click_request: MouseClickRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[MouseClickResponse]:
|
|
"""Click mouse
|
|
|
|
Click mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_click_request: (required)
|
|
:type mouse_click_request: MouseClickRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._click_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_click_request=mouse_click_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseClickResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def click_mouse_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_click_request: MouseClickRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Click mouse
|
|
|
|
Click mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_click_request: (required)
|
|
:type mouse_click_request: MouseClickRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._click_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_click_request=mouse_click_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseClickResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _click_mouse_serialize(
|
|
self,
|
|
sandbox_id,
|
|
mouse_click_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if mouse_click_request is not None:
|
|
_body_params = mouse_click_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/mouse/click',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def create_folder(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
mode: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Create folder
|
|
|
|
Create folder inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param mode: (required)
|
|
:type mode: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_folder_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
mode=mode,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def create_folder_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
mode: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Create folder
|
|
|
|
Create folder inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param mode: (required)
|
|
:type mode: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_folder_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
mode=mode,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def create_folder_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
mode: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Create folder
|
|
|
|
Create folder inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param mode: (required)
|
|
:type mode: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_folder_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
mode=mode,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _create_folder_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
mode,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
if mode is not None:
|
|
|
|
_query_params.append(('mode', mode))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/folder',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def create_session(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
create_session_request: CreateSessionRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Create session
|
|
|
|
Create a new session in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param create_session_request: (required)
|
|
:type create_session_request: CreateSessionRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
create_session_request=create_session_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def create_session_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
create_session_request: CreateSessionRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Create session
|
|
|
|
Create a new session in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param create_session_request: (required)
|
|
:type create_session_request: CreateSessionRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
create_session_request=create_session_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def create_session_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
create_session_request: CreateSessionRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Create session
|
|
|
|
Create a new session in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param create_session_request: (required)
|
|
:type create_session_request: CreateSessionRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._create_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
create_session_request=create_session_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _create_session_serialize(
|
|
self,
|
|
sandbox_id,
|
|
create_session_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if create_session_request is not None:
|
|
_body_params = create_session_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def delete_file(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Delete file
|
|
|
|
Delete file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def delete_file_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Delete file
|
|
|
|
Delete file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def delete_file_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Delete file
|
|
|
|
Delete file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _delete_file_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='DELETE',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def delete_session(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Delete session
|
|
|
|
Delete a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def delete_session_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Delete session
|
|
|
|
Delete a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def delete_session_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Delete session
|
|
|
|
Delete a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._delete_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _delete_session_serialize(
|
|
self,
|
|
sandbox_id,
|
|
session_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
if session_id is not None:
|
|
_path_params['sessionId'] = session_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='DELETE',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session/{sessionId}',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def download_file(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> bytearray:
|
|
"""Download file
|
|
|
|
Download file from sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._download_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "bytearray",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def download_file_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[bytearray]:
|
|
"""Download file
|
|
|
|
Download file from sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._download_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "bytearray",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def download_file_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Download file
|
|
|
|
Download file from sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._download_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "bytearray",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _download_file_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/download',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def drag_mouse(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_drag_request: MouseDragRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> MouseDragResponse:
|
|
"""Drag mouse
|
|
|
|
Drag mouse from start to end coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_drag_request: (required)
|
|
:type mouse_drag_request: MouseDragRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._drag_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_drag_request=mouse_drag_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseDragResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def drag_mouse_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_drag_request: MouseDragRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[MouseDragResponse]:
|
|
"""Drag mouse
|
|
|
|
Drag mouse from start to end coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_drag_request: (required)
|
|
:type mouse_drag_request: MouseDragRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._drag_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_drag_request=mouse_drag_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseDragResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def drag_mouse_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_drag_request: MouseDragRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Drag mouse
|
|
|
|
Drag mouse from start to end coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_drag_request: (required)
|
|
:type mouse_drag_request: MouseDragRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._drag_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_drag_request=mouse_drag_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseDragResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _drag_mouse_serialize(
|
|
self,
|
|
sandbox_id,
|
|
mouse_drag_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if mouse_drag_request is not None:
|
|
_body_params = mouse_drag_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/mouse/drag',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def execute_command(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
execute_request: ExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ExecuteResponse:
|
|
"""Execute command
|
|
|
|
Execute command synchronously inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param execute_request: (required)
|
|
:type execute_request: ExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
execute_request=execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def execute_command_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
execute_request: ExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ExecuteResponse]:
|
|
"""Execute command
|
|
|
|
Execute command synchronously inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param execute_request: (required)
|
|
:type execute_request: ExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
execute_request=execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def execute_command_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
execute_request: ExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Execute command
|
|
|
|
Execute command synchronously inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param execute_request: (required)
|
|
:type execute_request: ExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
execute_request=execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _execute_command_serialize(
|
|
self,
|
|
sandbox_id,
|
|
execute_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if execute_request is not None:
|
|
_body_params = execute_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/execute',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def execute_session_command(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
session_execute_request: SessionExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> SessionExecuteResponse:
|
|
"""Execute command in session
|
|
|
|
Execute a command in a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param session_execute_request: (required)
|
|
:type session_execute_request: SessionExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
session_execute_request=session_execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SessionExecuteResponse",
|
|
'202': "SessionExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def execute_session_command_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
session_execute_request: SessionExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[SessionExecuteResponse]:
|
|
"""Execute command in session
|
|
|
|
Execute a command in a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param session_execute_request: (required)
|
|
:type session_execute_request: SessionExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
session_execute_request=session_execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SessionExecuteResponse",
|
|
'202': "SessionExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def execute_session_command_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
session_execute_request: SessionExecuteRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Execute command in session
|
|
|
|
Execute a command in a specific session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param session_execute_request: (required)
|
|
:type session_execute_request: SessionExecuteRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._execute_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
session_execute_request=session_execute_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SessionExecuteResponse",
|
|
'202': "SessionExecuteResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _execute_session_command_serialize(
|
|
self,
|
|
sandbox_id,
|
|
session_id,
|
|
session_execute_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
if session_id is not None:
|
|
_path_params['sessionId'] = session_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if session_execute_request is not None:
|
|
_body_params = session_execute_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session/{sessionId}/exec',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def find_in_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[Match]:
|
|
"""Search for text/pattern in files
|
|
|
|
Search for text/pattern inside sandbox files
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._find_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Match]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def find_in_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[Match]]:
|
|
"""Search for text/pattern in files
|
|
|
|
Search for text/pattern inside sandbox files
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._find_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Match]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def find_in_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Search for text/pattern in files
|
|
|
|
Search for text/pattern inside sandbox files
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._find_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Match]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _find_in_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
pattern,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
if pattern is not None:
|
|
|
|
_query_params.append(('pattern', pattern))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/find',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_computer_use_status(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ComputerUseStatusResponse:
|
|
"""Get computer use status
|
|
|
|
Get status of all VNC desktop processes
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_computer_use_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_computer_use_status_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ComputerUseStatusResponse]:
|
|
"""Get computer use status
|
|
|
|
Get status of all VNC desktop processes
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_computer_use_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_computer_use_status_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get computer use status
|
|
|
|
Get status of all VNC desktop processes
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_computer_use_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_computer_use_status_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/status',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_display_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> DisplayInfoResponse:
|
|
"""Get display info
|
|
|
|
Get information about displays
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_display_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "DisplayInfoResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_display_info_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[DisplayInfoResponse]:
|
|
"""Get display info
|
|
|
|
Get information about displays
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_display_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "DisplayInfoResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_display_info_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get display info
|
|
|
|
Get information about displays
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_display_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "DisplayInfoResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_display_info_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/display/info',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_file_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> FileInfo:
|
|
"""Get file info
|
|
|
|
Get file info inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_file_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "FileInfo",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_file_info_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[FileInfo]:
|
|
"""Get file info
|
|
|
|
Get file info inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_file_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "FileInfo",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_file_info_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get file info
|
|
|
|
Get file info inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_file_info_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "FileInfo",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_file_info_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/info',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_mouse_position(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> MousePosition:
|
|
"""Get mouse position
|
|
|
|
Get current mouse cursor position
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_mouse_position_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MousePosition",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_mouse_position_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[MousePosition]:
|
|
"""Get mouse position
|
|
|
|
Get current mouse cursor position
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_mouse_position_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MousePosition",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_mouse_position_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get mouse position
|
|
|
|
Get current mouse cursor position
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_mouse_position_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MousePosition",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_mouse_position_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/mouse/position',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_process_errors(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ProcessErrorsResponse:
|
|
"""Get process errors
|
|
|
|
Get error logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_errors_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessErrorsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_process_errors_with_http_info(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ProcessErrorsResponse]:
|
|
"""Get process errors
|
|
|
|
Get error logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_errors_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessErrorsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_process_errors_without_preload_content(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get process errors
|
|
|
|
Get error logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_errors_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessErrorsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_process_errors_serialize(
|
|
self,
|
|
process_name,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if process_name is not None:
|
|
_path_params['processName'] = process_name
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/process/{processName}/errors',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_process_logs(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ProcessLogsResponse:
|
|
"""Get process logs
|
|
|
|
Get logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_logs_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessLogsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_process_logs_with_http_info(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ProcessLogsResponse]:
|
|
"""Get process logs
|
|
|
|
Get logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_logs_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessLogsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_process_logs_without_preload_content(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get process logs
|
|
|
|
Get logs for a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_logs_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessLogsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_process_logs_serialize(
|
|
self,
|
|
process_name,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if process_name is not None:
|
|
_path_params['processName'] = process_name
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/process/{processName}/logs',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_process_status(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ProcessStatusResponse:
|
|
"""Get process status
|
|
|
|
Get status of a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_status_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_process_status_with_http_info(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ProcessStatusResponse]:
|
|
"""Get process status
|
|
|
|
Get status of a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_status_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_process_status_without_preload_content(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get process status
|
|
|
|
Get status of a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_process_status_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessStatusResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_process_status_serialize(
|
|
self,
|
|
process_name,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if process_name is not None:
|
|
_path_params['processName'] = process_name
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/process/{processName}/status',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_project_dir(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ProjectDirResponse:
|
|
"""Get sandbox project dir
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_project_dir_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProjectDirResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_project_dir_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ProjectDirResponse]:
|
|
"""Get sandbox project dir
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_project_dir_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProjectDirResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_project_dir_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get sandbox project dir
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_project_dir_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProjectDirResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_project_dir_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/project-dir',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_session(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> Session:
|
|
"""Get session
|
|
|
|
Get session by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Session",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_session_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[Session]:
|
|
"""Get session
|
|
|
|
Get session by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Session",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_session_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get session
|
|
|
|
Get session by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Session",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_session_serialize(
|
|
self,
|
|
sandbox_id,
|
|
session_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
if session_id is not None:
|
|
_path_params['sessionId'] = session_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session/{sessionId}',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> Command:
|
|
"""Get session command
|
|
|
|
Get session command by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Command",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[Command]:
|
|
"""Get session command
|
|
|
|
Get session command by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Command",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get session command
|
|
|
|
Get session command by ID
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "Command",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_session_command_serialize(
|
|
self,
|
|
sandbox_id,
|
|
session_id,
|
|
command_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
if session_id is not None:
|
|
_path_params['sessionId'] = session_id
|
|
if command_id is not None:
|
|
_path_params['commandId'] = command_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session/{sessionId}/command/{commandId}',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command_logs(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
follow: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> str:
|
|
"""Get command logs
|
|
|
|
Get logs for a specific command in a session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param follow:
|
|
:type follow: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_logs_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
follow=follow,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "str",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command_logs_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
follow: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[str]:
|
|
"""Get command logs
|
|
|
|
Get logs for a specific command in a session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param follow:
|
|
:type follow: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_logs_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
follow=follow,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "str",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_session_command_logs_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
session_id: StrictStr,
|
|
command_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
follow: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get command logs
|
|
|
|
Get logs for a specific command in a session
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param session_id: (required)
|
|
:type session_id: str
|
|
:param command_id: (required)
|
|
:type command_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param follow:
|
|
:type follow: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_session_command_logs_serialize(
|
|
sandbox_id=sandbox_id,
|
|
session_id=session_id,
|
|
command_id=command_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
follow=follow,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "str",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_session_command_logs_serialize(
|
|
self,
|
|
sandbox_id,
|
|
session_id,
|
|
command_id,
|
|
x_hanzo_runtime_organization_id,
|
|
follow,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
if session_id is not None:
|
|
_path_params['sessionId'] = session_id
|
|
if command_id is not None:
|
|
_path_params['commandId'] = command_id
|
|
# process the query parameters
|
|
if follow is not None:
|
|
|
|
_query_params.append(('follow', follow))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'text/plain'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session/{sessionId}/command/{commandId}/logs',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def get_windows(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> WindowsResponse:
|
|
"""Get windows
|
|
|
|
Get list of open windows
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_windows_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "WindowsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def get_windows_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[WindowsResponse]:
|
|
"""Get windows
|
|
|
|
Get list of open windows
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_windows_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "WindowsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def get_windows_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get windows
|
|
|
|
Get list of open windows
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._get_windows_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "WindowsResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _get_windows_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/display/windows',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_add_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_add_request: GitAddRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Add files
|
|
|
|
Add files to git commit
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_add_request: (required)
|
|
:type git_add_request: GitAddRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_add_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_add_request=git_add_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_add_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_add_request: GitAddRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Add files
|
|
|
|
Add files to git commit
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_add_request: (required)
|
|
:type git_add_request: GitAddRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_add_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_add_request=git_add_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_add_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_add_request: GitAddRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Add files
|
|
|
|
Add files to git commit
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_add_request: (required)
|
|
:type git_add_request: GitAddRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_add_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_add_request=git_add_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_add_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_add_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_add_request is not None:
|
|
_body_params = git_add_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/add',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_checkout_branch(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_checkout_request: GitCheckoutRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Checkout branch
|
|
|
|
Checkout branch or commit in git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_checkout_request: (required)
|
|
:type git_checkout_request: GitCheckoutRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_checkout_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_checkout_request=git_checkout_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_checkout_branch_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_checkout_request: GitCheckoutRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Checkout branch
|
|
|
|
Checkout branch or commit in git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_checkout_request: (required)
|
|
:type git_checkout_request: GitCheckoutRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_checkout_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_checkout_request=git_checkout_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_checkout_branch_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_checkout_request: GitCheckoutRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Checkout branch
|
|
|
|
Checkout branch or commit in git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_checkout_request: (required)
|
|
:type git_checkout_request: GitCheckoutRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_checkout_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_checkout_request=git_checkout_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_checkout_branch_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_checkout_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_checkout_request is not None:
|
|
_body_params = git_checkout_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/checkout',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_clone_repository(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_clone_request: GitCloneRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Clone repository
|
|
|
|
Clone git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_clone_request: (required)
|
|
:type git_clone_request: GitCloneRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_clone_repository_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_clone_request=git_clone_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_clone_repository_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_clone_request: GitCloneRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Clone repository
|
|
|
|
Clone git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_clone_request: (required)
|
|
:type git_clone_request: GitCloneRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_clone_repository_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_clone_request=git_clone_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_clone_repository_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_clone_request: GitCloneRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Clone repository
|
|
|
|
Clone git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_clone_request: (required)
|
|
:type git_clone_request: GitCloneRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_clone_repository_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_clone_request=git_clone_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_clone_repository_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_clone_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_clone_request is not None:
|
|
_body_params = git_clone_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/clone',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_commit_changes(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_commit_request: GitCommitRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> GitCommitResponse:
|
|
"""Commit changes
|
|
|
|
Commit changes to git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_commit_request: (required)
|
|
:type git_commit_request: GitCommitRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_commit_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_commit_request=git_commit_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitCommitResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_commit_changes_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_commit_request: GitCommitRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[GitCommitResponse]:
|
|
"""Commit changes
|
|
|
|
Commit changes to git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_commit_request: (required)
|
|
:type git_commit_request: GitCommitRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_commit_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_commit_request=git_commit_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitCommitResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_commit_changes_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_commit_request: GitCommitRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Commit changes
|
|
|
|
Commit changes to git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_commit_request: (required)
|
|
:type git_commit_request: GitCommitRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_commit_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_commit_request=git_commit_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitCommitResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_commit_changes_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_commit_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_commit_request is not None:
|
|
_body_params = git_commit_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/commit',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_create_branch(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_branch_request: GitBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Create branch
|
|
|
|
Create branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_branch_request: (required)
|
|
:type git_branch_request: GitBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_create_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_branch_request=git_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_create_branch_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_branch_request: GitBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Create branch
|
|
|
|
Create branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_branch_request: (required)
|
|
:type git_branch_request: GitBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_create_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_branch_request=git_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_create_branch_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_branch_request: GitBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Create branch
|
|
|
|
Create branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_branch_request: (required)
|
|
:type git_branch_request: GitBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_create_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_branch_request=git_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_create_branch_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_branch_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_branch_request is not None:
|
|
_body_params = git_branch_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/branches',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_delete_branch(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_delete_branch_request: GitDeleteBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Delete branch
|
|
|
|
Delete branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_delete_branch_request: (required)
|
|
:type git_delete_branch_request: GitDeleteBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_delete_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_delete_branch_request=git_delete_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_delete_branch_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_delete_branch_request: GitDeleteBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Delete branch
|
|
|
|
Delete branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_delete_branch_request: (required)
|
|
:type git_delete_branch_request: GitDeleteBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_delete_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_delete_branch_request=git_delete_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_delete_branch_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_delete_branch_request: GitDeleteBranchRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Delete branch
|
|
|
|
Delete branch on git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_delete_branch_request: (required)
|
|
:type git_delete_branch_request: GitDeleteBranchRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_delete_branch_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_delete_branch_request=git_delete_branch_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_delete_branch_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_delete_branch_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_delete_branch_request is not None:
|
|
_body_params = git_delete_branch_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='DELETE',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/branches',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_get_history(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[GitCommitInfo]:
|
|
"""Get commit history
|
|
|
|
Get commit history from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_history_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[GitCommitInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_get_history_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[GitCommitInfo]]:
|
|
"""Get commit history
|
|
|
|
Get commit history from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_history_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[GitCommitInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_get_history_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get commit history
|
|
|
|
Get commit history from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_history_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[GitCommitInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_get_history_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/history',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_get_status(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> GitStatus:
|
|
"""Get git status
|
|
|
|
Get status from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitStatus",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_get_status_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[GitStatus]:
|
|
"""Get git status
|
|
|
|
Get status from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitStatus",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_get_status_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get git status
|
|
|
|
Get status from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_get_status_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "GitStatus",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_get_status_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/status',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_list_branches(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ListBranchResponse:
|
|
"""Get branch list
|
|
|
|
Get branch list from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_list_branches_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ListBranchResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_list_branches_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ListBranchResponse]:
|
|
"""Get branch list
|
|
|
|
Get branch list from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_list_branches_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ListBranchResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_list_branches_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get branch list
|
|
|
|
Get branch list from git repository
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_list_branches_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ListBranchResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_list_branches_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/branches',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_pull_changes(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Pull changes
|
|
|
|
Pull changes from remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_pull_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_pull_changes_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Pull changes
|
|
|
|
Pull changes from remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_pull_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_pull_changes_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Pull changes
|
|
|
|
Pull changes from remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_pull_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_pull_changes_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_repo_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_repo_request is not None:
|
|
_body_params = git_repo_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/pull',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def git_push_changes(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Push changes
|
|
|
|
Push changes to remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_push_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def git_push_changes_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Push changes
|
|
|
|
Push changes to remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_push_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def git_push_changes_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
git_repo_request: GitRepoRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Push changes
|
|
|
|
Push changes to remote
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param git_repo_request: (required)
|
|
:type git_repo_request: GitRepoRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._git_push_changes_serialize(
|
|
sandbox_id=sandbox_id,
|
|
git_repo_request=git_repo_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _git_push_changes_serialize(
|
|
self,
|
|
sandbox_id,
|
|
git_repo_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if git_repo_request is not None:
|
|
_body_params = git_repo_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/git/push',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def list_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
path: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[FileInfo]:
|
|
"""List files
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param path:
|
|
:type path: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
path=path,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[FileInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def list_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
path: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[FileInfo]]:
|
|
"""List files
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param path:
|
|
:type path: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
path=path,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[FileInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def list_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
path: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""List files
|
|
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param path:
|
|
:type path: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
path=path,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[FileInfo]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _list_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
path,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def list_sessions(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[Session]:
|
|
"""List sessions
|
|
|
|
List all active sessions in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_sessions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Session]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def list_sessions_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[Session]]:
|
|
"""List sessions
|
|
|
|
List all active sessions in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_sessions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Session]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def list_sessions_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""List sessions
|
|
|
|
List all active sessions in the sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._list_sessions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[Session]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _list_sessions_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/process/session',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_completions(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_completion_params: LspCompletionParams,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> CompletionList:
|
|
"""Get Lsp Completions
|
|
|
|
The Completion request is sent from the client to the server to compute completion items at a given cursor position.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_completion_params: (required)
|
|
:type lsp_completion_params: LspCompletionParams
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_completions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_completion_params=lsp_completion_params,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompletionList",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_completions_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_completion_params: LspCompletionParams,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[CompletionList]:
|
|
"""Get Lsp Completions
|
|
|
|
The Completion request is sent from the client to the server to compute completion items at a given cursor position.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_completion_params: (required)
|
|
:type lsp_completion_params: LspCompletionParams
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_completions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_completion_params=lsp_completion_params,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompletionList",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_completions_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_completion_params: LspCompletionParams,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Get Lsp Completions
|
|
|
|
The Completion request is sent from the client to the server to compute completion items at a given cursor position.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_completion_params: (required)
|
|
:type lsp_completion_params: LspCompletionParams
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_completions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_completion_params=lsp_completion_params,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompletionList",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_completions_serialize(
|
|
self,
|
|
sandbox_id,
|
|
lsp_completion_params,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if lsp_completion_params is not None:
|
|
_body_params = lsp_completion_params
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/completions',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_close(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Call Lsp DidClose
|
|
|
|
The document close notification is sent from the client to the server when the document got closed in the client.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_close_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_close_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Call Lsp DidClose
|
|
|
|
The document close notification is sent from the client to the server when the document got closed in the client.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_close_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_close_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Call Lsp DidClose
|
|
|
|
The document close notification is sent from the client to the server when the document got closed in the client.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_close_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_did_close_serialize(
|
|
self,
|
|
sandbox_id,
|
|
lsp_document_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if lsp_document_request is not None:
|
|
_body_params = lsp_document_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/did-close',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_open(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Call Lsp DidOpen
|
|
|
|
The document open notification is sent from the client to the server to signal newly opened text documents.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_open_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_open_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Call Lsp DidOpen
|
|
|
|
The document open notification is sent from the client to the server to signal newly opened text documents.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_open_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_did_open_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_document_request: LspDocumentRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Call Lsp DidOpen
|
|
|
|
The document open notification is sent from the client to the server to signal newly opened text documents.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_document_request: (required)
|
|
:type lsp_document_request: LspDocumentRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_did_open_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_document_request=lsp_document_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_did_open_serialize(
|
|
self,
|
|
sandbox_id,
|
|
lsp_document_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if lsp_document_request is not None:
|
|
_body_params = lsp_document_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/did-open',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_document_symbols(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
uri: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[LspSymbol]:
|
|
"""Call Lsp DocumentSymbols
|
|
|
|
The document symbol request is sent from the client to the server.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param uri: (required)
|
|
:type uri: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_document_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
uri=uri,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_document_symbols_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
uri: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[LspSymbol]]:
|
|
"""Call Lsp DocumentSymbols
|
|
|
|
The document symbol request is sent from the client to the server.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param uri: (required)
|
|
:type uri: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_document_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
uri=uri,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_document_symbols_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
uri: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Call Lsp DocumentSymbols
|
|
|
|
The document symbol request is sent from the client to the server.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param uri: (required)
|
|
:type uri: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_document_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
uri=uri,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_document_symbols_serialize(
|
|
self,
|
|
sandbox_id,
|
|
language_id,
|
|
path_to_project,
|
|
uri,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if language_id is not None:
|
|
|
|
_query_params.append(('languageId', language_id))
|
|
|
|
if path_to_project is not None:
|
|
|
|
_query_params.append(('pathToProject', path_to_project))
|
|
|
|
if uri is not None:
|
|
|
|
_query_params.append(('uri', uri))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/document-symbols',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_start(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Start Lsp server
|
|
|
|
Start Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_start_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_start_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Start Lsp server
|
|
|
|
Start Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_start_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_start_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Start Lsp server
|
|
|
|
Start Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_start_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_start_serialize(
|
|
self,
|
|
sandbox_id,
|
|
lsp_server_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if lsp_server_request is not None:
|
|
_body_params = lsp_server_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/start',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_stop(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Stop Lsp server
|
|
|
|
Stop Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_stop_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_stop_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Stop Lsp server
|
|
|
|
Stop Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_stop_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_stop_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
lsp_server_request: LspServerRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Stop Lsp server
|
|
|
|
Stop Lsp server process inside sandbox project
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param lsp_server_request: (required)
|
|
:type lsp_server_request: LspServerRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_stop_serialize(
|
|
sandbox_id=sandbox_id,
|
|
lsp_server_request=lsp_server_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_stop_serialize(
|
|
self,
|
|
sandbox_id,
|
|
lsp_server_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if lsp_server_request is not None:
|
|
_body_params = lsp_server_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/stop',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def lsp_workspace_symbols(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
query: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[LspSymbol]:
|
|
"""Call Lsp WorkspaceSymbols
|
|
|
|
The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param query: (required)
|
|
:type query: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_workspace_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
query=query,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def lsp_workspace_symbols_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
query: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[LspSymbol]]:
|
|
"""Call Lsp WorkspaceSymbols
|
|
|
|
The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param query: (required)
|
|
:type query: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_workspace_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
query=query,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def lsp_workspace_symbols_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
language_id: StrictStr,
|
|
path_to_project: StrictStr,
|
|
query: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Call Lsp WorkspaceSymbols
|
|
|
|
The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param language_id: (required)
|
|
:type language_id: str
|
|
:param path_to_project: (required)
|
|
:type path_to_project: str
|
|
:param query: (required)
|
|
:type query: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._lsp_workspace_symbols_serialize(
|
|
sandbox_id=sandbox_id,
|
|
language_id=language_id,
|
|
path_to_project=path_to_project,
|
|
query=query,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[LspSymbol]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _lsp_workspace_symbols_serialize(
|
|
self,
|
|
sandbox_id,
|
|
language_id,
|
|
path_to_project,
|
|
query,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if language_id is not None:
|
|
|
|
_query_params.append(('languageId', language_id))
|
|
|
|
if path_to_project is not None:
|
|
|
|
_query_params.append(('pathToProject', path_to_project))
|
|
|
|
if query is not None:
|
|
|
|
_query_params.append(('query', query))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/lsp/workspace-symbols',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def move_file(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
source: StrictStr,
|
|
destination: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Move file
|
|
|
|
Move file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param source: (required)
|
|
:type source: str
|
|
:param destination: (required)
|
|
:type destination: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
source=source,
|
|
destination=destination,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def move_file_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
source: StrictStr,
|
|
destination: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Move file
|
|
|
|
Move file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param source: (required)
|
|
:type source: str
|
|
:param destination: (required)
|
|
:type destination: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
source=source,
|
|
destination=destination,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def move_file_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
source: StrictStr,
|
|
destination: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Move file
|
|
|
|
Move file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param source: (required)
|
|
:type source: str
|
|
:param destination: (required)
|
|
:type destination: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
source=source,
|
|
destination=destination,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _move_file_serialize(
|
|
self,
|
|
sandbox_id,
|
|
source,
|
|
destination,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if source is not None:
|
|
|
|
_query_params.append(('source', source))
|
|
|
|
if destination is not None:
|
|
|
|
_query_params.append(('destination', destination))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/move',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def move_mouse(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_move_request: MouseMoveRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> MouseMoveResponse:
|
|
"""Move mouse
|
|
|
|
Move mouse cursor to specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_move_request: (required)
|
|
:type mouse_move_request: MouseMoveRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_move_request=mouse_move_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseMoveResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def move_mouse_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_move_request: MouseMoveRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[MouseMoveResponse]:
|
|
"""Move mouse
|
|
|
|
Move mouse cursor to specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_move_request: (required)
|
|
:type mouse_move_request: MouseMoveRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_move_request=mouse_move_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseMoveResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def move_mouse_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_move_request: MouseMoveRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Move mouse
|
|
|
|
Move mouse cursor to specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_move_request: (required)
|
|
:type mouse_move_request: MouseMoveRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._move_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_move_request=mouse_move_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseMoveResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _move_mouse_serialize(
|
|
self,
|
|
sandbox_id,
|
|
mouse_move_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if mouse_move_request is not None:
|
|
_body_params = mouse_move_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/mouse/move',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def press_hotkey(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_hotkey_request: KeyboardHotkeyRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Press hotkey
|
|
|
|
Press a hotkey combination
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_hotkey_request: (required)
|
|
:type keyboard_hotkey_request: KeyboardHotkeyRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_hotkey_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_hotkey_request=keyboard_hotkey_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def press_hotkey_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_hotkey_request: KeyboardHotkeyRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Press hotkey
|
|
|
|
Press a hotkey combination
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_hotkey_request: (required)
|
|
:type keyboard_hotkey_request: KeyboardHotkeyRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_hotkey_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_hotkey_request=keyboard_hotkey_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def press_hotkey_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_hotkey_request: KeyboardHotkeyRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Press hotkey
|
|
|
|
Press a hotkey combination
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_hotkey_request: (required)
|
|
:type keyboard_hotkey_request: KeyboardHotkeyRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_hotkey_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_hotkey_request=keyboard_hotkey_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _press_hotkey_serialize(
|
|
self,
|
|
sandbox_id,
|
|
keyboard_hotkey_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if keyboard_hotkey_request is not None:
|
|
_body_params = keyboard_hotkey_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/keyboard/hotkey',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def press_key(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_press_request: KeyboardPressRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Press key
|
|
|
|
Press a key with optional modifiers
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_press_request: (required)
|
|
:type keyboard_press_request: KeyboardPressRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_key_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_press_request=keyboard_press_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def press_key_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_press_request: KeyboardPressRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Press key
|
|
|
|
Press a key with optional modifiers
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_press_request: (required)
|
|
:type keyboard_press_request: KeyboardPressRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_key_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_press_request=keyboard_press_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def press_key_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_press_request: KeyboardPressRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Press key
|
|
|
|
Press a key with optional modifiers
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_press_request: (required)
|
|
:type keyboard_press_request: KeyboardPressRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._press_key_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_press_request=keyboard_press_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _press_key_serialize(
|
|
self,
|
|
sandbox_id,
|
|
keyboard_press_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if keyboard_press_request is not None:
|
|
_body_params = keyboard_press_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/keyboard/key',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def replace_in_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
replace_request: ReplaceRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> List[ReplaceResult]:
|
|
"""Replace in files
|
|
|
|
Replace text/pattern in multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param replace_request: (required)
|
|
:type replace_request: ReplaceRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._replace_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
replace_request=replace_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[ReplaceResult]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def replace_in_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
replace_request: ReplaceRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[List[ReplaceResult]]:
|
|
"""Replace in files
|
|
|
|
Replace text/pattern in multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param replace_request: (required)
|
|
:type replace_request: ReplaceRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._replace_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
replace_request=replace_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[ReplaceResult]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def replace_in_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
replace_request: ReplaceRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Replace in files
|
|
|
|
Replace text/pattern in multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param replace_request: (required)
|
|
:type replace_request: ReplaceRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._replace_in_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
replace_request=replace_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "List[ReplaceResult]",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _replace_in_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
replace_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if replace_request is not None:
|
|
_body_params = replace_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/replace',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def restart_process(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ProcessRestartResponse:
|
|
"""Restart process
|
|
|
|
Restart a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._restart_process_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessRestartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def restart_process_with_http_info(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ProcessRestartResponse]:
|
|
"""Restart process
|
|
|
|
Restart a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._restart_process_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessRestartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def restart_process_without_preload_content(
|
|
self,
|
|
process_name: StrictStr,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Restart process
|
|
|
|
Restart a specific VNC process
|
|
|
|
:param process_name: (required)
|
|
:type process_name: str
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._restart_process_serialize(
|
|
process_name=process_name,
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ProcessRestartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _restart_process_serialize(
|
|
self,
|
|
process_name,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if process_name is not None:
|
|
_path_params['processName'] = process_name
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/process/{processName}/restart',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def scroll_mouse(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_scroll_request: MouseScrollRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> MouseScrollResponse:
|
|
"""Scroll mouse
|
|
|
|
Scroll mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_scroll_request: (required)
|
|
:type mouse_scroll_request: MouseScrollRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._scroll_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_scroll_request=mouse_scroll_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseScrollResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def scroll_mouse_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_scroll_request: MouseScrollRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[MouseScrollResponse]:
|
|
"""Scroll mouse
|
|
|
|
Scroll mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_scroll_request: (required)
|
|
:type mouse_scroll_request: MouseScrollRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._scroll_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_scroll_request=mouse_scroll_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseScrollResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def scroll_mouse_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
mouse_scroll_request: MouseScrollRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Scroll mouse
|
|
|
|
Scroll mouse at specified coordinates
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param mouse_scroll_request: (required)
|
|
:type mouse_scroll_request: MouseScrollRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._scroll_mouse_serialize(
|
|
sandbox_id=sandbox_id,
|
|
mouse_scroll_request=mouse_scroll_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "MouseScrollResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _scroll_mouse_serialize(
|
|
self,
|
|
sandbox_id,
|
|
mouse_scroll_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if mouse_scroll_request is not None:
|
|
_body_params = mouse_scroll_request
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/mouse/scroll',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def search_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> SearchFilesResponse:
|
|
"""Search files
|
|
|
|
Search for files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._search_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SearchFilesResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def search_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[SearchFilesResponse]:
|
|
"""Search files
|
|
|
|
Search for files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._search_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SearchFilesResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def search_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
pattern: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Search files
|
|
|
|
Search for files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param pattern: (required)
|
|
:type pattern: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._search_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
pattern=pattern,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "SearchFilesResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _search_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
pattern,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
if pattern is not None:
|
|
|
|
_query_params.append(('pattern', pattern))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/search',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def set_file_permissions(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
owner: Optional[StrictStr] = None,
|
|
group: Optional[StrictStr] = None,
|
|
mode: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Set file permissions
|
|
|
|
Set file owner/group/permissions inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param owner:
|
|
:type owner: str
|
|
:param group:
|
|
:type group: str
|
|
:param mode:
|
|
:type mode: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._set_file_permissions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
owner=owner,
|
|
group=group,
|
|
mode=mode,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def set_file_permissions_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
owner: Optional[StrictStr] = None,
|
|
group: Optional[StrictStr] = None,
|
|
mode: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Set file permissions
|
|
|
|
Set file owner/group/permissions inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param owner:
|
|
:type owner: str
|
|
:param group:
|
|
:type group: str
|
|
:param mode:
|
|
:type mode: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._set_file_permissions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
owner=owner,
|
|
group=group,
|
|
mode=mode,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def set_file_permissions_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
owner: Optional[StrictStr] = None,
|
|
group: Optional[StrictStr] = None,
|
|
mode: Optional[StrictStr] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Set file permissions
|
|
|
|
Set file owner/group/permissions inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param owner:
|
|
:type owner: str
|
|
:param group:
|
|
:type group: str
|
|
:param mode:
|
|
:type mode: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._set_file_permissions_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
owner=owner,
|
|
group=group,
|
|
mode=mode,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _set_file_permissions_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
owner,
|
|
group,
|
|
mode,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
if owner is not None:
|
|
|
|
_query_params.append(('owner', owner))
|
|
|
|
if group is not None:
|
|
|
|
_query_params.append(('group', group))
|
|
|
|
if mode is not None:
|
|
|
|
_query_params.append(('mode', mode))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/permissions',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def start_computer_use(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ComputerUseStartResponse:
|
|
"""Start computer use processes
|
|
|
|
Start all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._start_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def start_computer_use_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ComputerUseStartResponse]:
|
|
"""Start computer use processes
|
|
|
|
Start all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._start_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def start_computer_use_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Start computer use processes
|
|
|
|
Start all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._start_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStartResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _start_computer_use_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/start',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def stop_computer_use(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ComputerUseStopResponse:
|
|
"""Stop computer use processes
|
|
|
|
Stop all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._stop_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStopResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def stop_computer_use_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ComputerUseStopResponse]:
|
|
"""Stop computer use processes
|
|
|
|
Stop all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._stop_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStopResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def stop_computer_use_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Stop computer use processes
|
|
|
|
Stop all VNC desktop processes (Xvfb, xfce4, x11vnc, novnc)
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._stop_computer_use_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ComputerUseStopResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _stop_computer_use_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/stop',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_region_screenshot(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> CompressedScreenshotResponse:
|
|
"""Take compressed region screenshot
|
|
|
|
Take a compressed screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_region_screenshot_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[CompressedScreenshotResponse]:
|
|
"""Take compressed region screenshot
|
|
|
|
Take a compressed screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_region_screenshot_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Take compressed region screenshot
|
|
|
|
Take a compressed screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _take_compressed_region_screenshot_serialize(
|
|
self,
|
|
sandbox_id,
|
|
height,
|
|
width,
|
|
y,
|
|
x,
|
|
x_hanzo_runtime_organization_id,
|
|
scale,
|
|
quality,
|
|
format,
|
|
show_cursor,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if scale is not None:
|
|
|
|
_query_params.append(('scale', scale))
|
|
|
|
if quality is not None:
|
|
|
|
_query_params.append(('quality', quality))
|
|
|
|
if format is not None:
|
|
|
|
_query_params.append(('format', format))
|
|
|
|
if show_cursor is not None:
|
|
|
|
_query_params.append(('show_cursor', show_cursor))
|
|
|
|
if height is not None:
|
|
|
|
_query_params.append(('height', height))
|
|
|
|
if width is not None:
|
|
|
|
_query_params.append(('width', width))
|
|
|
|
if y is not None:
|
|
|
|
_query_params.append(('y', y))
|
|
|
|
if x is not None:
|
|
|
|
_query_params.append(('x', x))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/screenshot/region/compressed',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_screenshot(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> CompressedScreenshotResponse:
|
|
"""Take compressed screenshot
|
|
|
|
Take a compressed screenshot with format, quality, and scale options
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_screenshot_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[CompressedScreenshotResponse]:
|
|
"""Take compressed screenshot
|
|
|
|
Take a compressed screenshot with format, quality, and scale options
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def take_compressed_screenshot_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
scale: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
quality: Optional[Union[StrictFloat, StrictInt]] = None,
|
|
format: Optional[StrictStr] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Take compressed screenshot
|
|
|
|
Take a compressed screenshot with format, quality, and scale options
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param scale:
|
|
:type scale: float
|
|
:param quality:
|
|
:type quality: float
|
|
:param format:
|
|
:type format: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_compressed_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
scale=scale,
|
|
quality=quality,
|
|
format=format,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "CompressedScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _take_compressed_screenshot_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
scale,
|
|
quality,
|
|
format,
|
|
show_cursor,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if scale is not None:
|
|
|
|
_query_params.append(('scale', scale))
|
|
|
|
if quality is not None:
|
|
|
|
_query_params.append(('quality', quality))
|
|
|
|
if format is not None:
|
|
|
|
_query_params.append(('format', format))
|
|
|
|
if show_cursor is not None:
|
|
|
|
_query_params.append(('show_cursor', show_cursor))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/screenshot/compressed',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def take_region_screenshot(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RegionScreenshotResponse:
|
|
"""Take region screenshot
|
|
|
|
Take a screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "RegionScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def take_region_screenshot_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[RegionScreenshotResponse]:
|
|
"""Take region screenshot
|
|
|
|
Take a screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "RegionScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def take_region_screenshot_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
height: Union[StrictFloat, StrictInt],
|
|
width: Union[StrictFloat, StrictInt],
|
|
y: Union[StrictFloat, StrictInt],
|
|
x: Union[StrictFloat, StrictInt],
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Take region screenshot
|
|
|
|
Take a screenshot of a specific region
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param height: (required)
|
|
:type height: float
|
|
:param width: (required)
|
|
:type width: float
|
|
:param y: (required)
|
|
:type y: float
|
|
:param x: (required)
|
|
:type x: float
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_region_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
height=height,
|
|
width=width,
|
|
y=y,
|
|
x=x,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "RegionScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _take_region_screenshot_serialize(
|
|
self,
|
|
sandbox_id,
|
|
height,
|
|
width,
|
|
y,
|
|
x,
|
|
x_hanzo_runtime_organization_id,
|
|
show_cursor,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if show_cursor is not None:
|
|
|
|
_query_params.append(('show_cursor', show_cursor))
|
|
|
|
if height is not None:
|
|
|
|
_query_params.append(('height', height))
|
|
|
|
if width is not None:
|
|
|
|
_query_params.append(('width', width))
|
|
|
|
if y is not None:
|
|
|
|
_query_params.append(('y', y))
|
|
|
|
if x is not None:
|
|
|
|
_query_params.append(('x', x))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/screenshot/region',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def take_screenshot(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ScreenshotResponse:
|
|
"""Take screenshot
|
|
|
|
Take a screenshot of the entire screen
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def take_screenshot_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[ScreenshotResponse]:
|
|
"""Take screenshot
|
|
|
|
Take a screenshot of the entire screen
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def take_screenshot_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
show_cursor: Optional[StrictBool] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Take screenshot
|
|
|
|
Take a screenshot of the entire screen
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param show_cursor:
|
|
:type show_cursor: bool
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._take_screenshot_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
show_cursor=show_cursor,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': "ScreenshotResponse",
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _take_screenshot_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
show_cursor,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if show_cursor is not None:
|
|
|
|
_query_params.append(('show_cursor', show_cursor))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
# set the HTTP header `Accept`
|
|
if 'Accept' not in _header_params:
|
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='GET',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/screenshot',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def type_text(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_type_request: KeyboardTypeRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Type text
|
|
|
|
Type text using keyboard
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_type_request: (required)
|
|
:type keyboard_type_request: KeyboardTypeRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._type_text_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_type_request=keyboard_type_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def type_text_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_type_request: KeyboardTypeRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Type text
|
|
|
|
Type text using keyboard
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_type_request: (required)
|
|
:type keyboard_type_request: KeyboardTypeRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._type_text_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_type_request=keyboard_type_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def type_text_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
keyboard_type_request: KeyboardTypeRequest,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Type text
|
|
|
|
Type text using keyboard
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param keyboard_type_request: (required)
|
|
:type keyboard_type_request: KeyboardTypeRequest
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._type_text_serialize(
|
|
sandbox_id=sandbox_id,
|
|
keyboard_type_request=keyboard_type_request,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _type_text_serialize(
|
|
self,
|
|
sandbox_id,
|
|
keyboard_type_request,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
if keyboard_type_request is not None:
|
|
_body_params = keyboard_type_request
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'application/json'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/computeruse/keyboard/type',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def upload_file(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""(Deprecated) Upload file
|
|
|
|
Upload file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param file:
|
|
:type file: bytearray
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
warnings.warn("POST /toolbox/{sandboxId}/toolbox/files/upload is deprecated.", DeprecationWarning)
|
|
|
|
_param = self._upload_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
file=file,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def upload_file_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""(Deprecated) Upload file
|
|
|
|
Upload file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param file:
|
|
:type file: bytearray
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
warnings.warn("POST /toolbox/{sandboxId}/toolbox/files/upload is deprecated.", DeprecationWarning)
|
|
|
|
_param = self._upload_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
file=file,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def upload_file_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
path: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""(Deprecated) Upload file
|
|
|
|
Upload file inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param path: (required)
|
|
:type path: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
:param file:
|
|
:type file: bytearray
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
warnings.warn("POST /toolbox/{sandboxId}/toolbox/files/upload is deprecated.", DeprecationWarning)
|
|
|
|
_param = self._upload_file_serialize(
|
|
sandbox_id=sandbox_id,
|
|
path=path,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
file=file,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _upload_file_serialize(
|
|
self,
|
|
sandbox_id,
|
|
path,
|
|
x_hanzo_runtime_organization_id,
|
|
file,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
if path is not None:
|
|
|
|
_query_params.append(('path', path))
|
|
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
if file is not None:
|
|
_files['file'] = file
|
|
# process the body parameter
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'multipart/form-data'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/upload',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|
|
|
|
|
|
@validate_call
|
|
async def upload_files(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> None:
|
|
"""Upload multiple files
|
|
|
|
Upload multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._upload_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
).data
|
|
|
|
|
|
@validate_call
|
|
async def upload_files_with_http_info(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> ApiResponse[None]:
|
|
"""Upload multiple files
|
|
|
|
Upload multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._upload_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
await response_data.read()
|
|
return self.api_client.response_deserialize(
|
|
response_data=response_data,
|
|
response_types_map=_response_types_map,
|
|
)
|
|
|
|
|
|
@validate_call
|
|
async def upload_files_without_preload_content(
|
|
self,
|
|
sandbox_id: StrictStr,
|
|
x_hanzo_runtime_organization_id: Annotated[Optional[StrictStr], Field(description="Use with JWT to specify the organization ID")] = None,
|
|
_request_timeout: Union[
|
|
None,
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Tuple[
|
|
Annotated[StrictFloat, Field(gt=0)],
|
|
Annotated[StrictFloat, Field(gt=0)]
|
|
]
|
|
] = None,
|
|
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
_content_type: Optional[StrictStr] = None,
|
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
) -> RESTResponseType:
|
|
"""Upload multiple files
|
|
|
|
Upload multiple files inside sandbox
|
|
|
|
:param sandbox_id: (required)
|
|
:type sandbox_id: str
|
|
:param x_hanzo_runtime_organization_id: Use with JWT to specify the organization ID
|
|
:type x_hanzo_runtime_organization_id: str
|
|
: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.
|
|
:type _request_timeout: int, tuple(int, int), optional
|
|
: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
|
|
:param _content_type: force content-type for the request.
|
|
:type _content_type: str, Optional
|
|
:param _headers: set to override the headers for a single
|
|
request; this effectively ignores the headers
|
|
in the spec for a single request.
|
|
:type _headers: dict, optional
|
|
:param _host_index: set to override the host_index for a single
|
|
request; this effectively ignores the host_index
|
|
in the spec for a single request.
|
|
:type _host_index: int, optional
|
|
:return: Returns the result object.
|
|
""" # noqa: E501
|
|
|
|
_param = self._upload_files_serialize(
|
|
sandbox_id=sandbox_id,
|
|
x_hanzo_runtime_organization_id=x_hanzo_runtime_organization_id,
|
|
_request_auth=_request_auth,
|
|
_content_type=_content_type,
|
|
_headers=_headers,
|
|
_host_index=_host_index
|
|
)
|
|
|
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
'200': None,
|
|
}
|
|
response_data = await self.api_client.call_api(
|
|
*_param,
|
|
_request_timeout=_request_timeout
|
|
)
|
|
return response_data.response
|
|
|
|
|
|
def _upload_files_serialize(
|
|
self,
|
|
sandbox_id,
|
|
x_hanzo_runtime_organization_id,
|
|
_request_auth,
|
|
_content_type,
|
|
_headers,
|
|
_host_index,
|
|
) -> RequestSerialized:
|
|
|
|
_host = None
|
|
|
|
_collection_formats: Dict[str, str] = {
|
|
}
|
|
|
|
_path_params: Dict[str, str] = {}
|
|
_query_params: List[Tuple[str, str]] = []
|
|
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
_form_params: List[Tuple[str, str]] = []
|
|
_files: Dict[
|
|
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
] = {}
|
|
_body_params: Optional[bytes] = None
|
|
|
|
# process the path parameters
|
|
if sandbox_id is not None:
|
|
_path_params['sandboxId'] = sandbox_id
|
|
# process the query parameters
|
|
# process the header parameters
|
|
if x_hanzo_runtime_organization_id is not None:
|
|
_header_params['X-Runtime-Organization-ID'] = x_hanzo_runtime_organization_id
|
|
# process the form parameters
|
|
# process the body parameter
|
|
|
|
|
|
|
|
# set the HTTP header `Content-Type`
|
|
if _content_type:
|
|
_header_params['Content-Type'] = _content_type
|
|
else:
|
|
_default_content_type = (
|
|
self.api_client.select_header_content_type(
|
|
[
|
|
'multipart/form-data'
|
|
]
|
|
)
|
|
)
|
|
if _default_content_type is not None:
|
|
_header_params['Content-Type'] = _default_content_type
|
|
|
|
# authentication setting
|
|
_auth_settings: List[str] = [
|
|
'bearer',
|
|
'oauth2'
|
|
]
|
|
|
|
return self.api_client.param_serialize(
|
|
method='POST',
|
|
resource_path='/toolbox/{sandboxId}/toolbox/files/bulk-upload',
|
|
path_params=_path_params,
|
|
query_params=_query_params,
|
|
header_params=_header_params,
|
|
body=_body_params,
|
|
post_params=_form_params,
|
|
files=_files,
|
|
auth_settings=_auth_settings,
|
|
collection_formats=_collection_formats,
|
|
_host=_host,
|
|
_request_auth=_request_auth
|
|
)
|
|
|
|
|