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.
Files changed (116) hide show
  1. cogbox_toolbox_api_client_async/__init__.py +386 -0
  2. cogbox_toolbox_api_client_async/api/__init__.py +46 -0
  3. cogbox_toolbox_api_client_async/api/computer_use_api.py +9075 -0
  4. cogbox_toolbox_api_client_async/api/file_system_api.py +3583 -0
  5. cogbox_toolbox_api_client_async/api/git_api.py +2969 -0
  6. cogbox_toolbox_api_client_async/api/info_api.py +773 -0
  7. cogbox_toolbox_api_client_async/api/interpreter_api.py +1075 -0
  8. cogbox_toolbox_api_client_async/api/lsp_api.py +1971 -0
  9. cogbox_toolbox_api_client_async/api/port_api.py +543 -0
  10. cogbox_toolbox_api_client_async/api/process_api.py +4865 -0
  11. cogbox_toolbox_api_client_async/api/server_api.py +298 -0
  12. cogbox_toolbox_api_client_async/api_client.py +812 -0
  13. cogbox_toolbox_api_client_async/api_response.py +21 -0
  14. cogbox_toolbox_api_client_async/configuration.py +624 -0
  15. cogbox_toolbox_api_client_async/exceptions.py +218 -0
  16. cogbox_toolbox_api_client_async/models/__init__.py +224 -0
  17. cogbox_toolbox_api_client_async/models/accessibility_bounds.py +108 -0
  18. cogbox_toolbox_api_client_async/models/accessibility_invoke_request.py +104 -0
  19. cogbox_toolbox_api_client_async/models/accessibility_node_request.py +102 -0
  20. cogbox_toolbox_api_client_async/models/accessibility_nodes_response.py +112 -0
  21. cogbox_toolbox_api_client_async/models/accessibility_set_value_request.py +104 -0
  22. cogbox_toolbox_api_client_async/models/accessibility_tree_response.py +108 -0
  23. cogbox_toolbox_api_client_async/models/chart.py +132 -0
  24. cogbox_toolbox_api_client_async/models/chart_element.py +134 -0
  25. cogbox_toolbox_api_client_async/models/code_run_artifacts.py +110 -0
  26. cogbox_toolbox_api_client_async/models/code_run_request.py +110 -0
  27. cogbox_toolbox_api_client_async/models/code_run_response.py +110 -0
  28. cogbox_toolbox_api_client_async/models/command.py +106 -0
  29. cogbox_toolbox_api_client_async/models/completion_context.py +104 -0
  30. cogbox_toolbox_api_client_async/models/completion_item.py +114 -0
  31. cogbox_toolbox_api_client_async/models/completion_list.py +112 -0
  32. cogbox_toolbox_api_client_async/models/computer_use_accessibility_node.py +129 -0
  33. cogbox_toolbox_api_client_async/models/computer_use_start_response.py +117 -0
  34. cogbox_toolbox_api_client_async/models/computer_use_status_response.py +102 -0
  35. cogbox_toolbox_api_client_async/models/computer_use_stop_response.py +117 -0
  36. cogbox_toolbox_api_client_async/models/create_context_request.py +104 -0
  37. cogbox_toolbox_api_client_async/models/create_session_request.py +102 -0
  38. cogbox_toolbox_api_client_async/models/display_info.py +112 -0
  39. cogbox_toolbox_api_client_async/models/display_info_response.py +110 -0
  40. cogbox_toolbox_api_client_async/models/execute_request.py +108 -0
  41. cogbox_toolbox_api_client_async/models/execute_response.py +104 -0
  42. cogbox_toolbox_api_client_async/models/file_info.py +118 -0
  43. cogbox_toolbox_api_client_async/models/file_status.py +109 -0
  44. cogbox_toolbox_api_client_async/models/files_download_request.py +102 -0
  45. cogbox_toolbox_api_client_async/models/find_accessibility_nodes_request.py +114 -0
  46. cogbox_toolbox_api_client_async/models/git_add_request.py +104 -0
  47. cogbox_toolbox_api_client_async/models/git_branch_request.py +104 -0
  48. cogbox_toolbox_api_client_async/models/git_checkout_request.py +104 -0
  49. cogbox_toolbox_api_client_async/models/git_clone_request.py +114 -0
  50. cogbox_toolbox_api_client_async/models/git_commit_info.py +110 -0
  51. cogbox_toolbox_api_client_async/models/git_commit_request.py +110 -0
  52. cogbox_toolbox_api_client_async/models/git_commit_response.py +102 -0
  53. cogbox_toolbox_api_client_async/models/git_delete_branch_request.py +104 -0
  54. cogbox_toolbox_api_client_async/models/git_repo_request.py +106 -0
  55. cogbox_toolbox_api_client_async/models/git_status.py +118 -0
  56. cogbox_toolbox_api_client_async/models/initialize_request.py +102 -0
  57. cogbox_toolbox_api_client_async/models/interpreter_context.py +110 -0
  58. cogbox_toolbox_api_client_async/models/is_port_in_use_response.py +102 -0
  59. cogbox_toolbox_api_client_async/models/keyboard_hotkey_request.py +102 -0
  60. cogbox_toolbox_api_client_async/models/keyboard_press_request.py +104 -0
  61. cogbox_toolbox_api_client_async/models/keyboard_type_request.py +104 -0
  62. cogbox_toolbox_api_client_async/models/list_branch_response.py +102 -0
  63. cogbox_toolbox_api_client_async/models/list_contexts_response.py +110 -0
  64. cogbox_toolbox_api_client_async/models/list_recordings_response.py +110 -0
  65. cogbox_toolbox_api_client_async/models/lsp_completion_params.py +118 -0
  66. cogbox_toolbox_api_client_async/models/lsp_document_request.py +106 -0
  67. cogbox_toolbox_api_client_async/models/lsp_location.py +108 -0
  68. cogbox_toolbox_api_client_async/models/lsp_position.py +104 -0
  69. cogbox_toolbox_api_client_async/models/lsp_range.py +111 -0
  70. cogbox_toolbox_api_client_async/models/lsp_server_request.py +104 -0
  71. cogbox_toolbox_api_client_async/models/lsp_symbol.py +110 -0
  72. cogbox_toolbox_api_client_async/models/match.py +106 -0
  73. cogbox_toolbox_api_client_async/models/mouse_click_request.py +108 -0
  74. cogbox_toolbox_api_client_async/models/mouse_click_response.py +104 -0
  75. cogbox_toolbox_api_client_async/models/mouse_drag_request.py +110 -0
  76. cogbox_toolbox_api_client_async/models/mouse_drag_response.py +104 -0
  77. cogbox_toolbox_api_client_async/models/mouse_move_request.py +104 -0
  78. cogbox_toolbox_api_client_async/models/mouse_position_response.py +104 -0
  79. cogbox_toolbox_api_client_async/models/mouse_scroll_request.py +109 -0
  80. cogbox_toolbox_api_client_async/models/port_list.py +102 -0
  81. cogbox_toolbox_api_client_async/models/position.py +104 -0
  82. cogbox_toolbox_api_client_async/models/process_errors_response.py +104 -0
  83. cogbox_toolbox_api_client_async/models/process_logs_response.py +104 -0
  84. cogbox_toolbox_api_client_async/models/process_restart_response.py +104 -0
  85. cogbox_toolbox_api_client_async/models/process_status.py +108 -0
  86. cogbox_toolbox_api_client_async/models/process_status_response.py +104 -0
  87. cogbox_toolbox_api_client_async/models/pty_create_request.py +112 -0
  88. cogbox_toolbox_api_client_async/models/pty_create_response.py +102 -0
  89. cogbox_toolbox_api_client_async/models/pty_list_response.py +110 -0
  90. cogbox_toolbox_api_client_async/models/pty_resize_request.py +105 -0
  91. cogbox_toolbox_api_client_async/models/pty_session_info.py +116 -0
  92. cogbox_toolbox_api_client_async/models/recording.py +116 -0
  93. cogbox_toolbox_api_client_async/models/replace_request.py +106 -0
  94. cogbox_toolbox_api_client_async/models/replace_result.py +106 -0
  95. cogbox_toolbox_api_client_async/models/screenshot_response.py +110 -0
  96. cogbox_toolbox_api_client_async/models/scroll_response.py +102 -0
  97. cogbox_toolbox_api_client_async/models/search_files_response.py +102 -0
  98. cogbox_toolbox_api_client_async/models/session.py +112 -0
  99. cogbox_toolbox_api_client_async/models/session_command_logs_response.py +106 -0
  100. cogbox_toolbox_api_client_async/models/session_execute_request.py +108 -0
  101. cogbox_toolbox_api_client_async/models/session_execute_response.py +110 -0
  102. cogbox_toolbox_api_client_async/models/session_send_input_request.py +102 -0
  103. cogbox_toolbox_api_client_async/models/start_recording_request.py +102 -0
  104. cogbox_toolbox_api_client_async/models/status.py +48 -0
  105. cogbox_toolbox_api_client_async/models/stop_recording_request.py +102 -0
  106. cogbox_toolbox_api_client_async/models/user_home_dir_response.py +102 -0
  107. cogbox_toolbox_api_client_async/models/window_info.py +114 -0
  108. cogbox_toolbox_api_client_async/models/windows_response.py +110 -0
  109. cogbox_toolbox_api_client_async/models/work_dir_response.py +102 -0
  110. cogbox_toolbox_api_client_async/py.typed +0 -0
  111. cogbox_toolbox_api_client_async/rest.py +226 -0
  112. cogbox_toolbox_api_client_async-0.190.1.dist-info/METADATA +20 -0
  113. cogbox_toolbox_api_client_async-0.190.1.dist-info/RECORD +116 -0
  114. cogbox_toolbox_api_client_async-0.190.1.dist-info/WHEEL +5 -0
  115. cogbox_toolbox_api_client_async-0.190.1.dist-info/licenses/LICENSE +190 -0
  116. cogbox_toolbox_api_client_async-0.190.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,543 @@
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
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictInt
19
+ from typing_extensions import Annotated
20
+ from cogbox_toolbox_api_client_async.models.is_port_in_use_response import IsPortInUseResponse
21
+ from cogbox_toolbox_api_client_async.models.port_list import PortList
22
+
23
+ from cogbox_toolbox_api_client_async.api_client import ApiClient, RequestSerialized
24
+ from cogbox_toolbox_api_client_async.api_response import ApiResponse
25
+ from cogbox_toolbox_api_client_async.rest import RESTResponseType
26
+
27
+
28
+ class PortApi:
29
+ """NOTE: This class is auto generated by OpenAPI Generator
30
+ Ref: https://openapi-generator.tech
31
+
32
+ Do not edit the class manually.
33
+ """
34
+
35
+ def __init__(self, api_client=None) -> None:
36
+ if api_client is None:
37
+ api_client = ApiClient.get_default()
38
+ self.api_client = api_client
39
+
40
+
41
+ @validate_call
42
+ async def get_ports(
43
+ self,
44
+ _request_timeout: Union[
45
+ None,
46
+ Annotated[StrictFloat, Field(gt=0)],
47
+ Tuple[
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Annotated[StrictFloat, Field(gt=0)]
50
+ ]
51
+ ] = None,
52
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
53
+ _content_type: Optional[StrictStr] = None,
54
+ _headers: Optional[Dict[StrictStr, Any]] = None,
55
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
56
+ ) -> PortList:
57
+ """Get active ports
58
+
59
+ Get a list of all currently active ports
60
+
61
+ :param _request_timeout: timeout setting for this request. If one
62
+ number provided, it will be total request
63
+ timeout. It can also be a pair (tuple) of
64
+ (connection, read) timeouts.
65
+ :type _request_timeout: int, tuple(int, int), optional
66
+ :param _request_auth: set to override the auth_settings for an a single
67
+ request; this effectively ignores the
68
+ authentication in the spec for a single request.
69
+ :type _request_auth: dict, optional
70
+ :param _content_type: force content-type for the request.
71
+ :type _content_type: str, Optional
72
+ :param _headers: set to override the headers for a single
73
+ request; this effectively ignores the headers
74
+ in the spec for a single request.
75
+ :type _headers: dict, optional
76
+ :param _host_index: set to override the host_index for a single
77
+ request; this effectively ignores the host_index
78
+ in the spec for a single request.
79
+ :type _host_index: int, optional
80
+ :return: Returns the result object.
81
+ """ # noqa: E501
82
+
83
+ _param = self._get_ports_serialize(
84
+ _request_auth=_request_auth,
85
+ _content_type=_content_type,
86
+ _headers=_headers,
87
+ _host_index=_host_index
88
+ )
89
+
90
+ _response_types_map: Dict[str, Optional[str]] = {
91
+ '200': "PortList",
92
+ }
93
+ response_data = await self.api_client.call_api(
94
+ *_param,
95
+ _request_timeout=_request_timeout
96
+ )
97
+ await response_data.read()
98
+ return self.api_client.response_deserialize(
99
+ response_data=response_data,
100
+ response_types_map=_response_types_map,
101
+ ).data
102
+
103
+
104
+ @validate_call
105
+ async def get_ports_with_http_info(
106
+ self,
107
+ _request_timeout: Union[
108
+ None,
109
+ Annotated[StrictFloat, Field(gt=0)],
110
+ Tuple[
111
+ Annotated[StrictFloat, Field(gt=0)],
112
+ Annotated[StrictFloat, Field(gt=0)]
113
+ ]
114
+ ] = None,
115
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
116
+ _content_type: Optional[StrictStr] = None,
117
+ _headers: Optional[Dict[StrictStr, Any]] = None,
118
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
119
+ ) -> ApiResponse[PortList]:
120
+ """Get active ports
121
+
122
+ Get a list of all currently active ports
123
+
124
+ :param _request_timeout: timeout setting for this request. If one
125
+ number provided, it will be total request
126
+ timeout. It can also be a pair (tuple) of
127
+ (connection, read) timeouts.
128
+ :type _request_timeout: int, tuple(int, int), optional
129
+ :param _request_auth: set to override the auth_settings for an a single
130
+ request; this effectively ignores the
131
+ authentication in the spec for a single request.
132
+ :type _request_auth: dict, optional
133
+ :param _content_type: force content-type for the request.
134
+ :type _content_type: str, Optional
135
+ :param _headers: set to override the headers for a single
136
+ request; this effectively ignores the headers
137
+ in the spec for a single request.
138
+ :type _headers: dict, optional
139
+ :param _host_index: set to override the host_index for a single
140
+ request; this effectively ignores the host_index
141
+ in the spec for a single request.
142
+ :type _host_index: int, optional
143
+ :return: Returns the result object.
144
+ """ # noqa: E501
145
+
146
+ _param = self._get_ports_serialize(
147
+ _request_auth=_request_auth,
148
+ _content_type=_content_type,
149
+ _headers=_headers,
150
+ _host_index=_host_index
151
+ )
152
+
153
+ _response_types_map: Dict[str, Optional[str]] = {
154
+ '200': "PortList",
155
+ }
156
+ response_data = await self.api_client.call_api(
157
+ *_param,
158
+ _request_timeout=_request_timeout
159
+ )
160
+ await response_data.read()
161
+ return self.api_client.response_deserialize(
162
+ response_data=response_data,
163
+ response_types_map=_response_types_map,
164
+ )
165
+
166
+
167
+ @validate_call
168
+ async def get_ports_without_preload_content(
169
+ self,
170
+ _request_timeout: Union[
171
+ None,
172
+ Annotated[StrictFloat, Field(gt=0)],
173
+ Tuple[
174
+ Annotated[StrictFloat, Field(gt=0)],
175
+ Annotated[StrictFloat, Field(gt=0)]
176
+ ]
177
+ ] = None,
178
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
179
+ _content_type: Optional[StrictStr] = None,
180
+ _headers: Optional[Dict[StrictStr, Any]] = None,
181
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
182
+ ) -> RESTResponseType:
183
+ """Get active ports
184
+
185
+ Get a list of all currently active ports
186
+
187
+ :param _request_timeout: timeout setting for this request. If one
188
+ number provided, it will be total request
189
+ timeout. It can also be a pair (tuple) of
190
+ (connection, read) timeouts.
191
+ :type _request_timeout: int, tuple(int, int), optional
192
+ :param _request_auth: set to override the auth_settings for an a single
193
+ request; this effectively ignores the
194
+ authentication in the spec for a single request.
195
+ :type _request_auth: dict, optional
196
+ :param _content_type: force content-type for the request.
197
+ :type _content_type: str, Optional
198
+ :param _headers: set to override the headers for a single
199
+ request; this effectively ignores the headers
200
+ in the spec for a single request.
201
+ :type _headers: dict, optional
202
+ :param _host_index: set to override the host_index for a single
203
+ request; this effectively ignores the host_index
204
+ in the spec for a single request.
205
+ :type _host_index: int, optional
206
+ :return: Returns the result object.
207
+ """ # noqa: E501
208
+
209
+ _param = self._get_ports_serialize(
210
+ _request_auth=_request_auth,
211
+ _content_type=_content_type,
212
+ _headers=_headers,
213
+ _host_index=_host_index
214
+ )
215
+
216
+ _response_types_map: Dict[str, Optional[str]] = {
217
+ '200': "PortList",
218
+ }
219
+ response_data = await self.api_client.call_api(
220
+ *_param,
221
+ _request_timeout=_request_timeout
222
+ )
223
+ return response_data.response
224
+
225
+
226
+ def _get_ports_serialize(
227
+ self,
228
+ _request_auth,
229
+ _content_type,
230
+ _headers,
231
+ _host_index,
232
+ ) -> RequestSerialized:
233
+
234
+ _host = None
235
+
236
+ _collection_formats: Dict[str, str] = {
237
+ }
238
+
239
+ _path_params: Dict[str, str] = {}
240
+ _query_params: List[Tuple[str, str]] = []
241
+ _header_params: Dict[str, Optional[str]] = _headers or {}
242
+ _form_params: List[Tuple[str, str]] = []
243
+ _files: Dict[
244
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
245
+ ] = {}
246
+ _body_params: Optional[bytes] = None
247
+
248
+ # process the path parameters
249
+ # process the query parameters
250
+ # process the header parameters
251
+ # process the form parameters
252
+ # process the body parameter
253
+
254
+
255
+ # set the HTTP header `Accept`
256
+ if 'Accept' not in _header_params:
257
+ _header_params['Accept'] = self.api_client.select_header_accept(
258
+ [
259
+ 'application/json'
260
+ ]
261
+ )
262
+
263
+
264
+ # authentication setting
265
+ _auth_settings: List[str] = [
266
+ ]
267
+
268
+ return self.api_client.param_serialize(
269
+ method='GET',
270
+ resource_path='/port',
271
+ path_params=_path_params,
272
+ query_params=_query_params,
273
+ header_params=_header_params,
274
+ body=_body_params,
275
+ post_params=_form_params,
276
+ files=_files,
277
+ auth_settings=_auth_settings,
278
+ collection_formats=_collection_formats,
279
+ _host=_host,
280
+ _request_auth=_request_auth
281
+ )
282
+
283
+
284
+
285
+
286
+ @validate_call
287
+ async def is_port_in_use(
288
+ self,
289
+ port: Annotated[StrictInt, Field(description="Port number (3000-9999)")],
290
+ _request_timeout: Union[
291
+ None,
292
+ Annotated[StrictFloat, Field(gt=0)],
293
+ Tuple[
294
+ Annotated[StrictFloat, Field(gt=0)],
295
+ Annotated[StrictFloat, Field(gt=0)]
296
+ ]
297
+ ] = None,
298
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
299
+ _content_type: Optional[StrictStr] = None,
300
+ _headers: Optional[Dict[StrictStr, Any]] = None,
301
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
302
+ ) -> IsPortInUseResponse:
303
+ """Check if port is in use
304
+
305
+ Check if a specific port is currently in use
306
+
307
+ :param port: Port number (3000-9999) (required)
308
+ :type port: int
309
+ :param _request_timeout: timeout setting for this request. If one
310
+ number provided, it will be total request
311
+ timeout. It can also be a pair (tuple) of
312
+ (connection, read) timeouts.
313
+ :type _request_timeout: int, tuple(int, int), optional
314
+ :param _request_auth: set to override the auth_settings for an a single
315
+ request; this effectively ignores the
316
+ authentication in the spec for a single request.
317
+ :type _request_auth: dict, optional
318
+ :param _content_type: force content-type for the request.
319
+ :type _content_type: str, Optional
320
+ :param _headers: set to override the headers for a single
321
+ request; this effectively ignores the headers
322
+ in the spec for a single request.
323
+ :type _headers: dict, optional
324
+ :param _host_index: set to override the host_index for a single
325
+ request; this effectively ignores the host_index
326
+ in the spec for a single request.
327
+ :type _host_index: int, optional
328
+ :return: Returns the result object.
329
+ """ # noqa: E501
330
+
331
+ _param = self._is_port_in_use_serialize(
332
+ port=port,
333
+ _request_auth=_request_auth,
334
+ _content_type=_content_type,
335
+ _headers=_headers,
336
+ _host_index=_host_index
337
+ )
338
+
339
+ _response_types_map: Dict[str, Optional[str]] = {
340
+ '200': "IsPortInUseResponse",
341
+ }
342
+ response_data = await self.api_client.call_api(
343
+ *_param,
344
+ _request_timeout=_request_timeout
345
+ )
346
+ await response_data.read()
347
+ return self.api_client.response_deserialize(
348
+ response_data=response_data,
349
+ response_types_map=_response_types_map,
350
+ ).data
351
+
352
+
353
+ @validate_call
354
+ async def is_port_in_use_with_http_info(
355
+ self,
356
+ port: Annotated[StrictInt, Field(description="Port number (3000-9999)")],
357
+ _request_timeout: Union[
358
+ None,
359
+ Annotated[StrictFloat, Field(gt=0)],
360
+ Tuple[
361
+ Annotated[StrictFloat, Field(gt=0)],
362
+ Annotated[StrictFloat, Field(gt=0)]
363
+ ]
364
+ ] = None,
365
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
366
+ _content_type: Optional[StrictStr] = None,
367
+ _headers: Optional[Dict[StrictStr, Any]] = None,
368
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
369
+ ) -> ApiResponse[IsPortInUseResponse]:
370
+ """Check if port is in use
371
+
372
+ Check if a specific port is currently in use
373
+
374
+ :param port: Port number (3000-9999) (required)
375
+ :type port: int
376
+ :param _request_timeout: timeout setting for this request. If one
377
+ number provided, it will be total request
378
+ timeout. It can also be a pair (tuple) of
379
+ (connection, read) timeouts.
380
+ :type _request_timeout: int, tuple(int, int), optional
381
+ :param _request_auth: set to override the auth_settings for an a single
382
+ request; this effectively ignores the
383
+ authentication in the spec for a single request.
384
+ :type _request_auth: dict, optional
385
+ :param _content_type: force content-type for the request.
386
+ :type _content_type: str, Optional
387
+ :param _headers: set to override the headers for a single
388
+ request; this effectively ignores the headers
389
+ in the spec for a single request.
390
+ :type _headers: dict, optional
391
+ :param _host_index: set to override the host_index for a single
392
+ request; this effectively ignores the host_index
393
+ in the spec for a single request.
394
+ :type _host_index: int, optional
395
+ :return: Returns the result object.
396
+ """ # noqa: E501
397
+
398
+ _param = self._is_port_in_use_serialize(
399
+ port=port,
400
+ _request_auth=_request_auth,
401
+ _content_type=_content_type,
402
+ _headers=_headers,
403
+ _host_index=_host_index
404
+ )
405
+
406
+ _response_types_map: Dict[str, Optional[str]] = {
407
+ '200': "IsPortInUseResponse",
408
+ }
409
+ response_data = await self.api_client.call_api(
410
+ *_param,
411
+ _request_timeout=_request_timeout
412
+ )
413
+ await response_data.read()
414
+ return self.api_client.response_deserialize(
415
+ response_data=response_data,
416
+ response_types_map=_response_types_map,
417
+ )
418
+
419
+
420
+ @validate_call
421
+ async def is_port_in_use_without_preload_content(
422
+ self,
423
+ port: Annotated[StrictInt, Field(description="Port number (3000-9999)")],
424
+ _request_timeout: Union[
425
+ None,
426
+ Annotated[StrictFloat, Field(gt=0)],
427
+ Tuple[
428
+ Annotated[StrictFloat, Field(gt=0)],
429
+ Annotated[StrictFloat, Field(gt=0)]
430
+ ]
431
+ ] = None,
432
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
433
+ _content_type: Optional[StrictStr] = None,
434
+ _headers: Optional[Dict[StrictStr, Any]] = None,
435
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
436
+ ) -> RESTResponseType:
437
+ """Check if port is in use
438
+
439
+ Check if a specific port is currently in use
440
+
441
+ :param port: Port number (3000-9999) (required)
442
+ :type port: int
443
+ :param _request_timeout: timeout setting for this request. If one
444
+ number provided, it will be total request
445
+ timeout. It can also be a pair (tuple) of
446
+ (connection, read) timeouts.
447
+ :type _request_timeout: int, tuple(int, int), optional
448
+ :param _request_auth: set to override the auth_settings for an a single
449
+ request; this effectively ignores the
450
+ authentication in the spec for a single request.
451
+ :type _request_auth: dict, optional
452
+ :param _content_type: force content-type for the request.
453
+ :type _content_type: str, Optional
454
+ :param _headers: set to override the headers for a single
455
+ request; this effectively ignores the headers
456
+ in the spec for a single request.
457
+ :type _headers: dict, optional
458
+ :param _host_index: set to override the host_index for a single
459
+ request; this effectively ignores the host_index
460
+ in the spec for a single request.
461
+ :type _host_index: int, optional
462
+ :return: Returns the result object.
463
+ """ # noqa: E501
464
+
465
+ _param = self._is_port_in_use_serialize(
466
+ port=port,
467
+ _request_auth=_request_auth,
468
+ _content_type=_content_type,
469
+ _headers=_headers,
470
+ _host_index=_host_index
471
+ )
472
+
473
+ _response_types_map: Dict[str, Optional[str]] = {
474
+ '200': "IsPortInUseResponse",
475
+ }
476
+ response_data = await self.api_client.call_api(
477
+ *_param,
478
+ _request_timeout=_request_timeout
479
+ )
480
+ return response_data.response
481
+
482
+
483
+ def _is_port_in_use_serialize(
484
+ self,
485
+ port,
486
+ _request_auth,
487
+ _content_type,
488
+ _headers,
489
+ _host_index,
490
+ ) -> RequestSerialized:
491
+
492
+ _host = None
493
+
494
+ _collection_formats: Dict[str, str] = {
495
+ }
496
+
497
+ _path_params: Dict[str, str] = {}
498
+ _query_params: List[Tuple[str, str]] = []
499
+ _header_params: Dict[str, Optional[str]] = _headers or {}
500
+ _form_params: List[Tuple[str, str]] = []
501
+ _files: Dict[
502
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
503
+ ] = {}
504
+ _body_params: Optional[bytes] = None
505
+
506
+ # process the path parameters
507
+ if port is not None:
508
+ _path_params['port'] = port
509
+ # process the query parameters
510
+ # process the header parameters
511
+ # process the form parameters
512
+ # process the body parameter
513
+
514
+
515
+ # set the HTTP header `Accept`
516
+ if 'Accept' not in _header_params:
517
+ _header_params['Accept'] = self.api_client.select_header_accept(
518
+ [
519
+ 'application/json'
520
+ ]
521
+ )
522
+
523
+
524
+ # authentication setting
525
+ _auth_settings: List[str] = [
526
+ ]
527
+
528
+ return self.api_client.param_serialize(
529
+ method='GET',
530
+ resource_path='/port/{port}/in-use',
531
+ path_params=_path_params,
532
+ query_params=_query_params,
533
+ header_params=_header_params,
534
+ body=_body_params,
535
+ post_params=_form_params,
536
+ files=_files,
537
+ auth_settings=_auth_settings,
538
+ collection_formats=_collection_formats,
539
+ _host=_host,
540
+ _request_auth=_request_auth
541
+ )
542
+
543
+