cogbox_toolbox_api_client_async 0.190.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cogbox_toolbox_api_client_async/__init__.py +386 -0
- cogbox_toolbox_api_client_async/api/__init__.py +46 -0
- cogbox_toolbox_api_client_async/api/computer_use_api.py +9075 -0
- cogbox_toolbox_api_client_async/api/file_system_api.py +3583 -0
- cogbox_toolbox_api_client_async/api/git_api.py +2969 -0
- cogbox_toolbox_api_client_async/api/info_api.py +773 -0
- cogbox_toolbox_api_client_async/api/interpreter_api.py +1075 -0
- cogbox_toolbox_api_client_async/api/lsp_api.py +1971 -0
- cogbox_toolbox_api_client_async/api/port_api.py +543 -0
- cogbox_toolbox_api_client_async/api/process_api.py +4865 -0
- cogbox_toolbox_api_client_async/api/server_api.py +298 -0
- cogbox_toolbox_api_client_async/api_client.py +812 -0
- cogbox_toolbox_api_client_async/api_response.py +21 -0
- cogbox_toolbox_api_client_async/configuration.py +624 -0
- cogbox_toolbox_api_client_async/exceptions.py +218 -0
- cogbox_toolbox_api_client_async/models/__init__.py +224 -0
- cogbox_toolbox_api_client_async/models/accessibility_bounds.py +108 -0
- cogbox_toolbox_api_client_async/models/accessibility_invoke_request.py +104 -0
- cogbox_toolbox_api_client_async/models/accessibility_node_request.py +102 -0
- cogbox_toolbox_api_client_async/models/accessibility_nodes_response.py +112 -0
- cogbox_toolbox_api_client_async/models/accessibility_set_value_request.py +104 -0
- cogbox_toolbox_api_client_async/models/accessibility_tree_response.py +108 -0
- cogbox_toolbox_api_client_async/models/chart.py +132 -0
- cogbox_toolbox_api_client_async/models/chart_element.py +134 -0
- cogbox_toolbox_api_client_async/models/code_run_artifacts.py +110 -0
- cogbox_toolbox_api_client_async/models/code_run_request.py +110 -0
- cogbox_toolbox_api_client_async/models/code_run_response.py +110 -0
- cogbox_toolbox_api_client_async/models/command.py +106 -0
- cogbox_toolbox_api_client_async/models/completion_context.py +104 -0
- cogbox_toolbox_api_client_async/models/completion_item.py +114 -0
- cogbox_toolbox_api_client_async/models/completion_list.py +112 -0
- cogbox_toolbox_api_client_async/models/computer_use_accessibility_node.py +129 -0
- cogbox_toolbox_api_client_async/models/computer_use_start_response.py +117 -0
- cogbox_toolbox_api_client_async/models/computer_use_status_response.py +102 -0
- cogbox_toolbox_api_client_async/models/computer_use_stop_response.py +117 -0
- cogbox_toolbox_api_client_async/models/create_context_request.py +104 -0
- cogbox_toolbox_api_client_async/models/create_session_request.py +102 -0
- cogbox_toolbox_api_client_async/models/display_info.py +112 -0
- cogbox_toolbox_api_client_async/models/display_info_response.py +110 -0
- cogbox_toolbox_api_client_async/models/execute_request.py +108 -0
- cogbox_toolbox_api_client_async/models/execute_response.py +104 -0
- cogbox_toolbox_api_client_async/models/file_info.py +118 -0
- cogbox_toolbox_api_client_async/models/file_status.py +109 -0
- cogbox_toolbox_api_client_async/models/files_download_request.py +102 -0
- cogbox_toolbox_api_client_async/models/find_accessibility_nodes_request.py +114 -0
- cogbox_toolbox_api_client_async/models/git_add_request.py +104 -0
- cogbox_toolbox_api_client_async/models/git_branch_request.py +104 -0
- cogbox_toolbox_api_client_async/models/git_checkout_request.py +104 -0
- cogbox_toolbox_api_client_async/models/git_clone_request.py +114 -0
- cogbox_toolbox_api_client_async/models/git_commit_info.py +110 -0
- cogbox_toolbox_api_client_async/models/git_commit_request.py +110 -0
- cogbox_toolbox_api_client_async/models/git_commit_response.py +102 -0
- cogbox_toolbox_api_client_async/models/git_delete_branch_request.py +104 -0
- cogbox_toolbox_api_client_async/models/git_repo_request.py +106 -0
- cogbox_toolbox_api_client_async/models/git_status.py +118 -0
- cogbox_toolbox_api_client_async/models/initialize_request.py +102 -0
- cogbox_toolbox_api_client_async/models/interpreter_context.py +110 -0
- cogbox_toolbox_api_client_async/models/is_port_in_use_response.py +102 -0
- cogbox_toolbox_api_client_async/models/keyboard_hotkey_request.py +102 -0
- cogbox_toolbox_api_client_async/models/keyboard_press_request.py +104 -0
- cogbox_toolbox_api_client_async/models/keyboard_type_request.py +104 -0
- cogbox_toolbox_api_client_async/models/list_branch_response.py +102 -0
- cogbox_toolbox_api_client_async/models/list_contexts_response.py +110 -0
- cogbox_toolbox_api_client_async/models/list_recordings_response.py +110 -0
- cogbox_toolbox_api_client_async/models/lsp_completion_params.py +118 -0
- cogbox_toolbox_api_client_async/models/lsp_document_request.py +106 -0
- cogbox_toolbox_api_client_async/models/lsp_location.py +108 -0
- cogbox_toolbox_api_client_async/models/lsp_position.py +104 -0
- cogbox_toolbox_api_client_async/models/lsp_range.py +111 -0
- cogbox_toolbox_api_client_async/models/lsp_server_request.py +104 -0
- cogbox_toolbox_api_client_async/models/lsp_symbol.py +110 -0
- cogbox_toolbox_api_client_async/models/match.py +106 -0
- cogbox_toolbox_api_client_async/models/mouse_click_request.py +108 -0
- cogbox_toolbox_api_client_async/models/mouse_click_response.py +104 -0
- cogbox_toolbox_api_client_async/models/mouse_drag_request.py +110 -0
- cogbox_toolbox_api_client_async/models/mouse_drag_response.py +104 -0
- cogbox_toolbox_api_client_async/models/mouse_move_request.py +104 -0
- cogbox_toolbox_api_client_async/models/mouse_position_response.py +104 -0
- cogbox_toolbox_api_client_async/models/mouse_scroll_request.py +109 -0
- cogbox_toolbox_api_client_async/models/port_list.py +102 -0
- cogbox_toolbox_api_client_async/models/position.py +104 -0
- cogbox_toolbox_api_client_async/models/process_errors_response.py +104 -0
- cogbox_toolbox_api_client_async/models/process_logs_response.py +104 -0
- cogbox_toolbox_api_client_async/models/process_restart_response.py +104 -0
- cogbox_toolbox_api_client_async/models/process_status.py +108 -0
- cogbox_toolbox_api_client_async/models/process_status_response.py +104 -0
- cogbox_toolbox_api_client_async/models/pty_create_request.py +112 -0
- cogbox_toolbox_api_client_async/models/pty_create_response.py +102 -0
- cogbox_toolbox_api_client_async/models/pty_list_response.py +110 -0
- cogbox_toolbox_api_client_async/models/pty_resize_request.py +105 -0
- cogbox_toolbox_api_client_async/models/pty_session_info.py +116 -0
- cogbox_toolbox_api_client_async/models/recording.py +116 -0
- cogbox_toolbox_api_client_async/models/replace_request.py +106 -0
- cogbox_toolbox_api_client_async/models/replace_result.py +106 -0
- cogbox_toolbox_api_client_async/models/screenshot_response.py +110 -0
- cogbox_toolbox_api_client_async/models/scroll_response.py +102 -0
- cogbox_toolbox_api_client_async/models/search_files_response.py +102 -0
- cogbox_toolbox_api_client_async/models/session.py +112 -0
- cogbox_toolbox_api_client_async/models/session_command_logs_response.py +106 -0
- cogbox_toolbox_api_client_async/models/session_execute_request.py +108 -0
- cogbox_toolbox_api_client_async/models/session_execute_response.py +110 -0
- cogbox_toolbox_api_client_async/models/session_send_input_request.py +102 -0
- cogbox_toolbox_api_client_async/models/start_recording_request.py +102 -0
- cogbox_toolbox_api_client_async/models/status.py +48 -0
- cogbox_toolbox_api_client_async/models/stop_recording_request.py +102 -0
- cogbox_toolbox_api_client_async/models/user_home_dir_response.py +102 -0
- cogbox_toolbox_api_client_async/models/window_info.py +114 -0
- cogbox_toolbox_api_client_async/models/windows_response.py +110 -0
- cogbox_toolbox_api_client_async/models/work_dir_response.py +102 -0
- cogbox_toolbox_api_client_async/py.typed +0 -0
- cogbox_toolbox_api_client_async/rest.py +226 -0
- cogbox_toolbox_api_client_async-0.190.1.dist-info/METADATA +20 -0
- cogbox_toolbox_api_client_async-0.190.1.dist-info/RECORD +116 -0
- cogbox_toolbox_api_client_async-0.190.1.dist-info/WHEEL +5 -0
- cogbox_toolbox_api_client_async-0.190.1.dist-info/licenses/LICENSE +190 -0
- cogbox_toolbox_api_client_async-0.190.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Cogbox Toolbox API
|
|
3
|
+
|
|
4
|
+
Cogbox Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Cogbox API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Cogbox Cloud: `https://proxy.cogbox.pazity.com/toolbox/{sandboxId}`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v0.0.0-dev
|
|
7
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
8
|
+
|
|
9
|
+
Do not edit the class manually.
|
|
10
|
+
""" # noqa: E501
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
from typing import Any, Optional
|
|
14
|
+
from typing_extensions import Self
|
|
15
|
+
|
|
16
|
+
class OpenApiException(Exception):
|
|
17
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
21
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
22
|
+
key_type=None) -> None:
|
|
23
|
+
""" Raises an exception for TypeErrors
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
msg (str): the exception message
|
|
27
|
+
|
|
28
|
+
Keyword Args:
|
|
29
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
30
|
+
current_item
|
|
31
|
+
None if unset
|
|
32
|
+
valid_classes (tuple): the primitive classes that current item
|
|
33
|
+
should be an instance of
|
|
34
|
+
None if unset
|
|
35
|
+
key_type (bool): False if our value is a value in a dict
|
|
36
|
+
True if it is a key in a dict
|
|
37
|
+
False if our item is an item in a list
|
|
38
|
+
None if unset
|
|
39
|
+
"""
|
|
40
|
+
self.path_to_item = path_to_item
|
|
41
|
+
self.valid_classes = valid_classes
|
|
42
|
+
self.key_type = key_type
|
|
43
|
+
full_msg = msg
|
|
44
|
+
if path_to_item:
|
|
45
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
46
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
50
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
51
|
+
"""
|
|
52
|
+
Args:
|
|
53
|
+
msg (str): the exception message
|
|
54
|
+
|
|
55
|
+
Keyword Args:
|
|
56
|
+
path_to_item (list) the path to the exception in the
|
|
57
|
+
received_data dict. None if unset
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
self.path_to_item = path_to_item
|
|
61
|
+
full_msg = msg
|
|
62
|
+
if path_to_item:
|
|
63
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
64
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
68
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
69
|
+
"""
|
|
70
|
+
Raised when an attribute reference or assignment fails.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
msg (str): the exception message
|
|
74
|
+
|
|
75
|
+
Keyword Args:
|
|
76
|
+
path_to_item (None/list) the path to the exception in the
|
|
77
|
+
received_data dict
|
|
78
|
+
"""
|
|
79
|
+
self.path_to_item = path_to_item
|
|
80
|
+
full_msg = msg
|
|
81
|
+
if path_to_item:
|
|
82
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
83
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
87
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
88
|
+
"""
|
|
89
|
+
Args:
|
|
90
|
+
msg (str): the exception message
|
|
91
|
+
|
|
92
|
+
Keyword Args:
|
|
93
|
+
path_to_item (None/list) the path to the exception in the
|
|
94
|
+
received_data dict
|
|
95
|
+
"""
|
|
96
|
+
self.path_to_item = path_to_item
|
|
97
|
+
full_msg = msg
|
|
98
|
+
if path_to_item:
|
|
99
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
100
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class ApiException(OpenApiException):
|
|
104
|
+
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
status=None,
|
|
108
|
+
reason=None,
|
|
109
|
+
http_resp=None,
|
|
110
|
+
*,
|
|
111
|
+
body: Optional[str] = None,
|
|
112
|
+
data: Optional[Any] = None,
|
|
113
|
+
) -> None:
|
|
114
|
+
self.status = status
|
|
115
|
+
self.reason = reason
|
|
116
|
+
self.body = body
|
|
117
|
+
self.data = data
|
|
118
|
+
self.headers = None
|
|
119
|
+
|
|
120
|
+
if http_resp:
|
|
121
|
+
if self.status is None:
|
|
122
|
+
self.status = http_resp.status
|
|
123
|
+
if self.reason is None:
|
|
124
|
+
self.reason = http_resp.reason
|
|
125
|
+
if self.body is None:
|
|
126
|
+
try:
|
|
127
|
+
self.body = http_resp.data.decode('utf-8')
|
|
128
|
+
except Exception:
|
|
129
|
+
pass
|
|
130
|
+
self.headers = http_resp.headers
|
|
131
|
+
|
|
132
|
+
@classmethod
|
|
133
|
+
def from_response(
|
|
134
|
+
cls,
|
|
135
|
+
*,
|
|
136
|
+
http_resp,
|
|
137
|
+
body: Optional[str],
|
|
138
|
+
data: Optional[Any],
|
|
139
|
+
) -> Self:
|
|
140
|
+
if http_resp.status == 400:
|
|
141
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
142
|
+
|
|
143
|
+
if http_resp.status == 401:
|
|
144
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
145
|
+
|
|
146
|
+
if http_resp.status == 403:
|
|
147
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
148
|
+
|
|
149
|
+
if http_resp.status == 404:
|
|
150
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
151
|
+
|
|
152
|
+
# Added new conditions for 409 and 422
|
|
153
|
+
if http_resp.status == 409:
|
|
154
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
155
|
+
|
|
156
|
+
if http_resp.status == 422:
|
|
157
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
158
|
+
|
|
159
|
+
if 500 <= http_resp.status <= 599:
|
|
160
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
161
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
162
|
+
|
|
163
|
+
def __str__(self):
|
|
164
|
+
"""Custom error messages for exception"""
|
|
165
|
+
error_message = "({0})\n"\
|
|
166
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
167
|
+
if self.headers:
|
|
168
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
169
|
+
self.headers)
|
|
170
|
+
|
|
171
|
+
if self.body:
|
|
172
|
+
error_message += "HTTP response body: {0}\n".format(self.body)
|
|
173
|
+
|
|
174
|
+
if self.data:
|
|
175
|
+
error_message += "HTTP response data: {0}\n".format(self.data)
|
|
176
|
+
|
|
177
|
+
return error_message
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class BadRequestException(ApiException):
|
|
181
|
+
pass
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class NotFoundException(ApiException):
|
|
185
|
+
pass
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class UnauthorizedException(ApiException):
|
|
189
|
+
pass
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class ForbiddenException(ApiException):
|
|
193
|
+
pass
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class ServiceException(ApiException):
|
|
197
|
+
pass
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ConflictException(ApiException):
|
|
201
|
+
"""Exception for HTTP 409 Conflict."""
|
|
202
|
+
pass
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class UnprocessableEntityException(ApiException):
|
|
206
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
207
|
+
pass
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def render_path(path_to_item):
|
|
211
|
+
"""Returns a string representation of a path"""
|
|
212
|
+
result = ""
|
|
213
|
+
for pth in path_to_item:
|
|
214
|
+
if isinstance(pth, int):
|
|
215
|
+
result += "[{0}]".format(pth)
|
|
216
|
+
else:
|
|
217
|
+
result += "['{0}']".format(pth)
|
|
218
|
+
return result
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
# flake8: noqa
|
|
6
|
+
"""
|
|
7
|
+
Cogbox Toolbox API
|
|
8
|
+
|
|
9
|
+
Cogbox Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Cogbox API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Cogbox Cloud: `https://proxy.cogbox.pazity.com/toolbox/{sandboxId}`.
|
|
10
|
+
|
|
11
|
+
The version of the OpenAPI document: v0.0.0-dev
|
|
12
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
13
|
+
|
|
14
|
+
Do not edit the class manually.
|
|
15
|
+
""" # noqa: E501
|
|
16
|
+
|
|
17
|
+
import importlib
|
|
18
|
+
from typing import TYPE_CHECKING
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
# import models into model package
|
|
22
|
+
from cogbox_toolbox_api_client_async.models.accessibility_bounds import AccessibilityBounds
|
|
23
|
+
from cogbox_toolbox_api_client_async.models.accessibility_invoke_request import AccessibilityInvokeRequest
|
|
24
|
+
from cogbox_toolbox_api_client_async.models.accessibility_node_request import AccessibilityNodeRequest
|
|
25
|
+
from cogbox_toolbox_api_client_async.models.accessibility_nodes_response import AccessibilityNodesResponse
|
|
26
|
+
from cogbox_toolbox_api_client_async.models.accessibility_set_value_request import AccessibilitySetValueRequest
|
|
27
|
+
from cogbox_toolbox_api_client_async.models.accessibility_tree_response import AccessibilityTreeResponse
|
|
28
|
+
from cogbox_toolbox_api_client_async.models.chart import Chart
|
|
29
|
+
from cogbox_toolbox_api_client_async.models.chart_element import ChartElement
|
|
30
|
+
from cogbox_toolbox_api_client_async.models.code_run_artifacts import CodeRunArtifacts
|
|
31
|
+
from cogbox_toolbox_api_client_async.models.code_run_request import CodeRunRequest
|
|
32
|
+
from cogbox_toolbox_api_client_async.models.code_run_response import CodeRunResponse
|
|
33
|
+
from cogbox_toolbox_api_client_async.models.command import Command
|
|
34
|
+
from cogbox_toolbox_api_client_async.models.completion_context import CompletionContext
|
|
35
|
+
from cogbox_toolbox_api_client_async.models.completion_item import CompletionItem
|
|
36
|
+
from cogbox_toolbox_api_client_async.models.completion_list import CompletionList
|
|
37
|
+
from cogbox_toolbox_api_client_async.models.computer_use_accessibility_node import ComputerUseAccessibilityNode
|
|
38
|
+
from cogbox_toolbox_api_client_async.models.computer_use_start_response import ComputerUseStartResponse
|
|
39
|
+
from cogbox_toolbox_api_client_async.models.computer_use_status_response import ComputerUseStatusResponse
|
|
40
|
+
from cogbox_toolbox_api_client_async.models.computer_use_stop_response import ComputerUseStopResponse
|
|
41
|
+
from cogbox_toolbox_api_client_async.models.create_context_request import CreateContextRequest
|
|
42
|
+
from cogbox_toolbox_api_client_async.models.create_session_request import CreateSessionRequest
|
|
43
|
+
from cogbox_toolbox_api_client_async.models.display_info import DisplayInfo
|
|
44
|
+
from cogbox_toolbox_api_client_async.models.display_info_response import DisplayInfoResponse
|
|
45
|
+
from cogbox_toolbox_api_client_async.models.execute_request import ExecuteRequest
|
|
46
|
+
from cogbox_toolbox_api_client_async.models.execute_response import ExecuteResponse
|
|
47
|
+
from cogbox_toolbox_api_client_async.models.file_info import FileInfo
|
|
48
|
+
from cogbox_toolbox_api_client_async.models.file_status import FileStatus
|
|
49
|
+
from cogbox_toolbox_api_client_async.models.files_download_request import FilesDownloadRequest
|
|
50
|
+
from cogbox_toolbox_api_client_async.models.find_accessibility_nodes_request import FindAccessibilityNodesRequest
|
|
51
|
+
from cogbox_toolbox_api_client_async.models.git_add_request import GitAddRequest
|
|
52
|
+
from cogbox_toolbox_api_client_async.models.git_branch_request import GitBranchRequest
|
|
53
|
+
from cogbox_toolbox_api_client_async.models.git_checkout_request import GitCheckoutRequest
|
|
54
|
+
from cogbox_toolbox_api_client_async.models.git_clone_request import GitCloneRequest
|
|
55
|
+
from cogbox_toolbox_api_client_async.models.git_commit_info import GitCommitInfo
|
|
56
|
+
from cogbox_toolbox_api_client_async.models.git_commit_request import GitCommitRequest
|
|
57
|
+
from cogbox_toolbox_api_client_async.models.git_commit_response import GitCommitResponse
|
|
58
|
+
from cogbox_toolbox_api_client_async.models.git_delete_branch_request import GitDeleteBranchRequest
|
|
59
|
+
from cogbox_toolbox_api_client_async.models.git_repo_request import GitRepoRequest
|
|
60
|
+
from cogbox_toolbox_api_client_async.models.git_status import GitStatus
|
|
61
|
+
from cogbox_toolbox_api_client_async.models.initialize_request import InitializeRequest
|
|
62
|
+
from cogbox_toolbox_api_client_async.models.interpreter_context import InterpreterContext
|
|
63
|
+
from cogbox_toolbox_api_client_async.models.is_port_in_use_response import IsPortInUseResponse
|
|
64
|
+
from cogbox_toolbox_api_client_async.models.keyboard_hotkey_request import KeyboardHotkeyRequest
|
|
65
|
+
from cogbox_toolbox_api_client_async.models.keyboard_press_request import KeyboardPressRequest
|
|
66
|
+
from cogbox_toolbox_api_client_async.models.keyboard_type_request import KeyboardTypeRequest
|
|
67
|
+
from cogbox_toolbox_api_client_async.models.list_branch_response import ListBranchResponse
|
|
68
|
+
from cogbox_toolbox_api_client_async.models.list_contexts_response import ListContextsResponse
|
|
69
|
+
from cogbox_toolbox_api_client_async.models.list_recordings_response import ListRecordingsResponse
|
|
70
|
+
from cogbox_toolbox_api_client_async.models.lsp_completion_params import LspCompletionParams
|
|
71
|
+
from cogbox_toolbox_api_client_async.models.lsp_document_request import LspDocumentRequest
|
|
72
|
+
from cogbox_toolbox_api_client_async.models.lsp_location import LspLocation
|
|
73
|
+
from cogbox_toolbox_api_client_async.models.lsp_position import LspPosition
|
|
74
|
+
from cogbox_toolbox_api_client_async.models.lsp_range import LspRange
|
|
75
|
+
from cogbox_toolbox_api_client_async.models.lsp_server_request import LspServerRequest
|
|
76
|
+
from cogbox_toolbox_api_client_async.models.lsp_symbol import LspSymbol
|
|
77
|
+
from cogbox_toolbox_api_client_async.models.match import Match
|
|
78
|
+
from cogbox_toolbox_api_client_async.models.mouse_click_request import MouseClickRequest
|
|
79
|
+
from cogbox_toolbox_api_client_async.models.mouse_click_response import MouseClickResponse
|
|
80
|
+
from cogbox_toolbox_api_client_async.models.mouse_drag_request import MouseDragRequest
|
|
81
|
+
from cogbox_toolbox_api_client_async.models.mouse_drag_response import MouseDragResponse
|
|
82
|
+
from cogbox_toolbox_api_client_async.models.mouse_move_request import MouseMoveRequest
|
|
83
|
+
from cogbox_toolbox_api_client_async.models.mouse_position_response import MousePositionResponse
|
|
84
|
+
from cogbox_toolbox_api_client_async.models.mouse_scroll_request import MouseScrollRequest
|
|
85
|
+
from cogbox_toolbox_api_client_async.models.port_list import PortList
|
|
86
|
+
from cogbox_toolbox_api_client_async.models.position import Position
|
|
87
|
+
from cogbox_toolbox_api_client_async.models.process_errors_response import ProcessErrorsResponse
|
|
88
|
+
from cogbox_toolbox_api_client_async.models.process_logs_response import ProcessLogsResponse
|
|
89
|
+
from cogbox_toolbox_api_client_async.models.process_restart_response import ProcessRestartResponse
|
|
90
|
+
from cogbox_toolbox_api_client_async.models.process_status import ProcessStatus
|
|
91
|
+
from cogbox_toolbox_api_client_async.models.process_status_response import ProcessStatusResponse
|
|
92
|
+
from cogbox_toolbox_api_client_async.models.pty_create_request import PtyCreateRequest
|
|
93
|
+
from cogbox_toolbox_api_client_async.models.pty_create_response import PtyCreateResponse
|
|
94
|
+
from cogbox_toolbox_api_client_async.models.pty_list_response import PtyListResponse
|
|
95
|
+
from cogbox_toolbox_api_client_async.models.pty_resize_request import PtyResizeRequest
|
|
96
|
+
from cogbox_toolbox_api_client_async.models.pty_session_info import PtySessionInfo
|
|
97
|
+
from cogbox_toolbox_api_client_async.models.recording import Recording
|
|
98
|
+
from cogbox_toolbox_api_client_async.models.replace_request import ReplaceRequest
|
|
99
|
+
from cogbox_toolbox_api_client_async.models.replace_result import ReplaceResult
|
|
100
|
+
from cogbox_toolbox_api_client_async.models.screenshot_response import ScreenshotResponse
|
|
101
|
+
from cogbox_toolbox_api_client_async.models.scroll_response import ScrollResponse
|
|
102
|
+
from cogbox_toolbox_api_client_async.models.search_files_response import SearchFilesResponse
|
|
103
|
+
from cogbox_toolbox_api_client_async.models.session import Session
|
|
104
|
+
from cogbox_toolbox_api_client_async.models.session_command_logs_response import SessionCommandLogsResponse
|
|
105
|
+
from cogbox_toolbox_api_client_async.models.session_execute_request import SessionExecuteRequest
|
|
106
|
+
from cogbox_toolbox_api_client_async.models.session_execute_response import SessionExecuteResponse
|
|
107
|
+
from cogbox_toolbox_api_client_async.models.session_send_input_request import SessionSendInputRequest
|
|
108
|
+
from cogbox_toolbox_api_client_async.models.start_recording_request import StartRecordingRequest
|
|
109
|
+
from cogbox_toolbox_api_client_async.models.status import Status
|
|
110
|
+
from cogbox_toolbox_api_client_async.models.stop_recording_request import StopRecordingRequest
|
|
111
|
+
from cogbox_toolbox_api_client_async.models.user_home_dir_response import UserHomeDirResponse
|
|
112
|
+
from cogbox_toolbox_api_client_async.models.window_info import WindowInfo
|
|
113
|
+
from cogbox_toolbox_api_client_async.models.windows_response import WindowsResponse
|
|
114
|
+
from cogbox_toolbox_api_client_async.models.work_dir_response import WorkDirResponse
|
|
115
|
+
|
|
116
|
+
_DYNAMIC_IMPORTS: dict[str, str] = {
|
|
117
|
+
"AccessibilityBounds": "cogbox_toolbox_api_client_async.models.accessibility_bounds",
|
|
118
|
+
"AccessibilityInvokeRequest": "cogbox_toolbox_api_client_async.models.accessibility_invoke_request",
|
|
119
|
+
"AccessibilityNodeRequest": "cogbox_toolbox_api_client_async.models.accessibility_node_request",
|
|
120
|
+
"AccessibilityNodesResponse": "cogbox_toolbox_api_client_async.models.accessibility_nodes_response",
|
|
121
|
+
"AccessibilitySetValueRequest": "cogbox_toolbox_api_client_async.models.accessibility_set_value_request",
|
|
122
|
+
"AccessibilityTreeResponse": "cogbox_toolbox_api_client_async.models.accessibility_tree_response",
|
|
123
|
+
"Chart": "cogbox_toolbox_api_client_async.models.chart",
|
|
124
|
+
"ChartElement": "cogbox_toolbox_api_client_async.models.chart_element",
|
|
125
|
+
"CodeRunArtifacts": "cogbox_toolbox_api_client_async.models.code_run_artifacts",
|
|
126
|
+
"CodeRunRequest": "cogbox_toolbox_api_client_async.models.code_run_request",
|
|
127
|
+
"CodeRunResponse": "cogbox_toolbox_api_client_async.models.code_run_response",
|
|
128
|
+
"Command": "cogbox_toolbox_api_client_async.models.command",
|
|
129
|
+
"CompletionContext": "cogbox_toolbox_api_client_async.models.completion_context",
|
|
130
|
+
"CompletionItem": "cogbox_toolbox_api_client_async.models.completion_item",
|
|
131
|
+
"CompletionList": "cogbox_toolbox_api_client_async.models.completion_list",
|
|
132
|
+
"ComputerUseAccessibilityNode": "cogbox_toolbox_api_client_async.models.computer_use_accessibility_node",
|
|
133
|
+
"ComputerUseStartResponse": "cogbox_toolbox_api_client_async.models.computer_use_start_response",
|
|
134
|
+
"ComputerUseStatusResponse": "cogbox_toolbox_api_client_async.models.computer_use_status_response",
|
|
135
|
+
"ComputerUseStopResponse": "cogbox_toolbox_api_client_async.models.computer_use_stop_response",
|
|
136
|
+
"CreateContextRequest": "cogbox_toolbox_api_client_async.models.create_context_request",
|
|
137
|
+
"CreateSessionRequest": "cogbox_toolbox_api_client_async.models.create_session_request",
|
|
138
|
+
"DisplayInfo": "cogbox_toolbox_api_client_async.models.display_info",
|
|
139
|
+
"DisplayInfoResponse": "cogbox_toolbox_api_client_async.models.display_info_response",
|
|
140
|
+
"ExecuteRequest": "cogbox_toolbox_api_client_async.models.execute_request",
|
|
141
|
+
"ExecuteResponse": "cogbox_toolbox_api_client_async.models.execute_response",
|
|
142
|
+
"FileInfo": "cogbox_toolbox_api_client_async.models.file_info",
|
|
143
|
+
"FileStatus": "cogbox_toolbox_api_client_async.models.file_status",
|
|
144
|
+
"FilesDownloadRequest": "cogbox_toolbox_api_client_async.models.files_download_request",
|
|
145
|
+
"FindAccessibilityNodesRequest": "cogbox_toolbox_api_client_async.models.find_accessibility_nodes_request",
|
|
146
|
+
"GitAddRequest": "cogbox_toolbox_api_client_async.models.git_add_request",
|
|
147
|
+
"GitBranchRequest": "cogbox_toolbox_api_client_async.models.git_branch_request",
|
|
148
|
+
"GitCheckoutRequest": "cogbox_toolbox_api_client_async.models.git_checkout_request",
|
|
149
|
+
"GitCloneRequest": "cogbox_toolbox_api_client_async.models.git_clone_request",
|
|
150
|
+
"GitCommitInfo": "cogbox_toolbox_api_client_async.models.git_commit_info",
|
|
151
|
+
"GitCommitRequest": "cogbox_toolbox_api_client_async.models.git_commit_request",
|
|
152
|
+
"GitCommitResponse": "cogbox_toolbox_api_client_async.models.git_commit_response",
|
|
153
|
+
"GitDeleteBranchRequest": "cogbox_toolbox_api_client_async.models.git_delete_branch_request",
|
|
154
|
+
"GitRepoRequest": "cogbox_toolbox_api_client_async.models.git_repo_request",
|
|
155
|
+
"GitStatus": "cogbox_toolbox_api_client_async.models.git_status",
|
|
156
|
+
"InitializeRequest": "cogbox_toolbox_api_client_async.models.initialize_request",
|
|
157
|
+
"InterpreterContext": "cogbox_toolbox_api_client_async.models.interpreter_context",
|
|
158
|
+
"IsPortInUseResponse": "cogbox_toolbox_api_client_async.models.is_port_in_use_response",
|
|
159
|
+
"KeyboardHotkeyRequest": "cogbox_toolbox_api_client_async.models.keyboard_hotkey_request",
|
|
160
|
+
"KeyboardPressRequest": "cogbox_toolbox_api_client_async.models.keyboard_press_request",
|
|
161
|
+
"KeyboardTypeRequest": "cogbox_toolbox_api_client_async.models.keyboard_type_request",
|
|
162
|
+
"ListBranchResponse": "cogbox_toolbox_api_client_async.models.list_branch_response",
|
|
163
|
+
"ListContextsResponse": "cogbox_toolbox_api_client_async.models.list_contexts_response",
|
|
164
|
+
"ListRecordingsResponse": "cogbox_toolbox_api_client_async.models.list_recordings_response",
|
|
165
|
+
"LspCompletionParams": "cogbox_toolbox_api_client_async.models.lsp_completion_params",
|
|
166
|
+
"LspDocumentRequest": "cogbox_toolbox_api_client_async.models.lsp_document_request",
|
|
167
|
+
"LspLocation": "cogbox_toolbox_api_client_async.models.lsp_location",
|
|
168
|
+
"LspPosition": "cogbox_toolbox_api_client_async.models.lsp_position",
|
|
169
|
+
"LspRange": "cogbox_toolbox_api_client_async.models.lsp_range",
|
|
170
|
+
"LspServerRequest": "cogbox_toolbox_api_client_async.models.lsp_server_request",
|
|
171
|
+
"LspSymbol": "cogbox_toolbox_api_client_async.models.lsp_symbol",
|
|
172
|
+
"Match": "cogbox_toolbox_api_client_async.models.match",
|
|
173
|
+
"MouseClickRequest": "cogbox_toolbox_api_client_async.models.mouse_click_request",
|
|
174
|
+
"MouseClickResponse": "cogbox_toolbox_api_client_async.models.mouse_click_response",
|
|
175
|
+
"MouseDragRequest": "cogbox_toolbox_api_client_async.models.mouse_drag_request",
|
|
176
|
+
"MouseDragResponse": "cogbox_toolbox_api_client_async.models.mouse_drag_response",
|
|
177
|
+
"MouseMoveRequest": "cogbox_toolbox_api_client_async.models.mouse_move_request",
|
|
178
|
+
"MousePositionResponse": "cogbox_toolbox_api_client_async.models.mouse_position_response",
|
|
179
|
+
"MouseScrollRequest": "cogbox_toolbox_api_client_async.models.mouse_scroll_request",
|
|
180
|
+
"PortList": "cogbox_toolbox_api_client_async.models.port_list",
|
|
181
|
+
"Position": "cogbox_toolbox_api_client_async.models.position",
|
|
182
|
+
"ProcessErrorsResponse": "cogbox_toolbox_api_client_async.models.process_errors_response",
|
|
183
|
+
"ProcessLogsResponse": "cogbox_toolbox_api_client_async.models.process_logs_response",
|
|
184
|
+
"ProcessRestartResponse": "cogbox_toolbox_api_client_async.models.process_restart_response",
|
|
185
|
+
"ProcessStatus": "cogbox_toolbox_api_client_async.models.process_status",
|
|
186
|
+
"ProcessStatusResponse": "cogbox_toolbox_api_client_async.models.process_status_response",
|
|
187
|
+
"PtyCreateRequest": "cogbox_toolbox_api_client_async.models.pty_create_request",
|
|
188
|
+
"PtyCreateResponse": "cogbox_toolbox_api_client_async.models.pty_create_response",
|
|
189
|
+
"PtyListResponse": "cogbox_toolbox_api_client_async.models.pty_list_response",
|
|
190
|
+
"PtyResizeRequest": "cogbox_toolbox_api_client_async.models.pty_resize_request",
|
|
191
|
+
"PtySessionInfo": "cogbox_toolbox_api_client_async.models.pty_session_info",
|
|
192
|
+
"Recording": "cogbox_toolbox_api_client_async.models.recording",
|
|
193
|
+
"ReplaceRequest": "cogbox_toolbox_api_client_async.models.replace_request",
|
|
194
|
+
"ReplaceResult": "cogbox_toolbox_api_client_async.models.replace_result",
|
|
195
|
+
"ScreenshotResponse": "cogbox_toolbox_api_client_async.models.screenshot_response",
|
|
196
|
+
"ScrollResponse": "cogbox_toolbox_api_client_async.models.scroll_response",
|
|
197
|
+
"SearchFilesResponse": "cogbox_toolbox_api_client_async.models.search_files_response",
|
|
198
|
+
"Session": "cogbox_toolbox_api_client_async.models.session",
|
|
199
|
+
"SessionCommandLogsResponse": "cogbox_toolbox_api_client_async.models.session_command_logs_response",
|
|
200
|
+
"SessionExecuteRequest": "cogbox_toolbox_api_client_async.models.session_execute_request",
|
|
201
|
+
"SessionExecuteResponse": "cogbox_toolbox_api_client_async.models.session_execute_response",
|
|
202
|
+
"SessionSendInputRequest": "cogbox_toolbox_api_client_async.models.session_send_input_request",
|
|
203
|
+
"StartRecordingRequest": "cogbox_toolbox_api_client_async.models.start_recording_request",
|
|
204
|
+
"Status": "cogbox_toolbox_api_client_async.models.status",
|
|
205
|
+
"StopRecordingRequest": "cogbox_toolbox_api_client_async.models.stop_recording_request",
|
|
206
|
+
"UserHomeDirResponse": "cogbox_toolbox_api_client_async.models.user_home_dir_response",
|
|
207
|
+
"WindowInfo": "cogbox_toolbox_api_client_async.models.window_info",
|
|
208
|
+
"WindowsResponse": "cogbox_toolbox_api_client_async.models.windows_response",
|
|
209
|
+
"WorkDirResponse": "cogbox_toolbox_api_client_async.models.work_dir_response",
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def __getattr__(attr_name: str) -> object:
|
|
214
|
+
module_path = _DYNAMIC_IMPORTS.get(attr_name)
|
|
215
|
+
if module_path is None:
|
|
216
|
+
raise AttributeError(f"module {__name__!r} has no attribute {attr_name!r}")
|
|
217
|
+
mod = importlib.import_module(module_path)
|
|
218
|
+
value = getattr(mod, attr_name)
|
|
219
|
+
globals()[attr_name] = value
|
|
220
|
+
return value
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def __dir__() -> list[str]:
|
|
224
|
+
return list(_DYNAMIC_IMPORTS.keys())
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Cogbox Toolbox API
|
|
5
|
+
|
|
6
|
+
Cogbox Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Cogbox API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Cogbox Cloud: `https://proxy.cogbox.pazity.com/toolbox/{sandboxId}`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v0.0.0-dev
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import TypeAdapter
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
_JSON_ADAPTER = TypeAdapter(Dict[str, Any])
|
|
27
|
+
|
|
28
|
+
class AccessibilityBounds(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
AccessibilityBounds
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
height: Optional[StrictInt] = None
|
|
33
|
+
width: Optional[StrictInt] = None
|
|
34
|
+
x: Optional[StrictInt] = None
|
|
35
|
+
y: Optional[StrictInt] = None
|
|
36
|
+
additional_properties: Dict[str, Any] = {}
|
|
37
|
+
__properties: ClassVar[List[str]] = ["height", "width", "x", "y"]
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return _JSON_ADAPTER.dump_json(self.to_dict()).decode()
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of AccessibilityBounds from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
"additional_properties",
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
# puts key-value pairs in additional_properties in the top level
|
|
80
|
+
if self.additional_properties is not None:
|
|
81
|
+
for _key, _value in self.additional_properties.items():
|
|
82
|
+
_dict[_key] = _value
|
|
83
|
+
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of AccessibilityBounds from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"height": obj.get("height"),
|
|
97
|
+
"width": obj.get("width"),
|
|
98
|
+
"x": obj.get("x"),
|
|
99
|
+
"y": obj.get("y")
|
|
100
|
+
})
|
|
101
|
+
# store additional fields in additional_properties
|
|
102
|
+
for _key in obj.keys():
|
|
103
|
+
if _key not in cls.__properties:
|
|
104
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
105
|
+
|
|
106
|
+
return _obj
|
|
107
|
+
|
|
108
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Cogbox Toolbox API
|
|
5
|
+
|
|
6
|
+
Cogbox Toolbox API. The base URL comes from the sandbox's `toolboxProxyUrl` field (returned in sandbox DTO by the main Cogbox API) plus the sandbox ID: `{toolboxProxyUrl}/{sandboxId}/{endpoint}`. Default for Cogbox Cloud: `https://proxy.cogbox.pazity.com/toolbox/{sandboxId}`.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v0.0.0-dev
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pydantic import TypeAdapter
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
_JSON_ADAPTER = TypeAdapter(Dict[str, Any])
|
|
27
|
+
|
|
28
|
+
class AccessibilityInvokeRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
AccessibilityInvokeRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
action: Optional[StrictStr] = None
|
|
33
|
+
id: StrictStr
|
|
34
|
+
additional_properties: Dict[str, Any] = {}
|
|
35
|
+
__properties: ClassVar[List[str]] = ["action", "id"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return _JSON_ADAPTER.dump_json(self.to_dict()).decode()
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of AccessibilityInvokeRequest from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
"additional_properties",
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
|
78
|
+
if self.additional_properties is not None:
|
|
79
|
+
for _key, _value in self.additional_properties.items():
|
|
80
|
+
_dict[_key] = _value
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of AccessibilityInvokeRequest from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"action": obj.get("action"),
|
|
95
|
+
"id": obj.get("id")
|
|
96
|
+
})
|
|
97
|
+
# store additional fields in additional_properties
|
|
98
|
+
for _key in obj.keys():
|
|
99
|
+
if _key not in cls.__properties:
|
|
100
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
101
|
+
|
|
102
|
+
return _obj
|
|
103
|
+
|
|
104
|
+
|