cogbox_toolbox_api_client 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/__init__.py +386 -0
  2. cogbox_toolbox_api_client/api/__init__.py +46 -0
  3. cogbox_toolbox_api_client/api/computer_use_api.py +9075 -0
  4. cogbox_toolbox_api_client/api/file_system_api.py +3583 -0
  5. cogbox_toolbox_api_client/api/git_api.py +2969 -0
  6. cogbox_toolbox_api_client/api/info_api.py +773 -0
  7. cogbox_toolbox_api_client/api/interpreter_api.py +1075 -0
  8. cogbox_toolbox_api_client/api/lsp_api.py +1971 -0
  9. cogbox_toolbox_api_client/api/port_api.py +543 -0
  10. cogbox_toolbox_api_client/api/process_api.py +4865 -0
  11. cogbox_toolbox_api_client/api/server_api.py +298 -0
  12. cogbox_toolbox_api_client/api_client.py +809 -0
  13. cogbox_toolbox_api_client/api_response.py +21 -0
  14. cogbox_toolbox_api_client/configuration.py +626 -0
  15. cogbox_toolbox_api_client/exceptions.py +218 -0
  16. cogbox_toolbox_api_client/models/__init__.py +224 -0
  17. cogbox_toolbox_api_client/models/accessibility_bounds.py +108 -0
  18. cogbox_toolbox_api_client/models/accessibility_invoke_request.py +104 -0
  19. cogbox_toolbox_api_client/models/accessibility_node_request.py +102 -0
  20. cogbox_toolbox_api_client/models/accessibility_nodes_response.py +112 -0
  21. cogbox_toolbox_api_client/models/accessibility_set_value_request.py +104 -0
  22. cogbox_toolbox_api_client/models/accessibility_tree_response.py +108 -0
  23. cogbox_toolbox_api_client/models/chart.py +132 -0
  24. cogbox_toolbox_api_client/models/chart_element.py +134 -0
  25. cogbox_toolbox_api_client/models/code_run_artifacts.py +110 -0
  26. cogbox_toolbox_api_client/models/code_run_request.py +110 -0
  27. cogbox_toolbox_api_client/models/code_run_response.py +110 -0
  28. cogbox_toolbox_api_client/models/command.py +106 -0
  29. cogbox_toolbox_api_client/models/completion_context.py +104 -0
  30. cogbox_toolbox_api_client/models/completion_item.py +114 -0
  31. cogbox_toolbox_api_client/models/completion_list.py +112 -0
  32. cogbox_toolbox_api_client/models/computer_use_accessibility_node.py +129 -0
  33. cogbox_toolbox_api_client/models/computer_use_start_response.py +117 -0
  34. cogbox_toolbox_api_client/models/computer_use_status_response.py +102 -0
  35. cogbox_toolbox_api_client/models/computer_use_stop_response.py +117 -0
  36. cogbox_toolbox_api_client/models/create_context_request.py +104 -0
  37. cogbox_toolbox_api_client/models/create_session_request.py +102 -0
  38. cogbox_toolbox_api_client/models/display_info.py +112 -0
  39. cogbox_toolbox_api_client/models/display_info_response.py +110 -0
  40. cogbox_toolbox_api_client/models/execute_request.py +108 -0
  41. cogbox_toolbox_api_client/models/execute_response.py +104 -0
  42. cogbox_toolbox_api_client/models/file_info.py +118 -0
  43. cogbox_toolbox_api_client/models/file_status.py +109 -0
  44. cogbox_toolbox_api_client/models/files_download_request.py +102 -0
  45. cogbox_toolbox_api_client/models/find_accessibility_nodes_request.py +114 -0
  46. cogbox_toolbox_api_client/models/git_add_request.py +104 -0
  47. cogbox_toolbox_api_client/models/git_branch_request.py +104 -0
  48. cogbox_toolbox_api_client/models/git_checkout_request.py +104 -0
  49. cogbox_toolbox_api_client/models/git_clone_request.py +114 -0
  50. cogbox_toolbox_api_client/models/git_commit_info.py +110 -0
  51. cogbox_toolbox_api_client/models/git_commit_request.py +110 -0
  52. cogbox_toolbox_api_client/models/git_commit_response.py +102 -0
  53. cogbox_toolbox_api_client/models/git_delete_branch_request.py +104 -0
  54. cogbox_toolbox_api_client/models/git_repo_request.py +106 -0
  55. cogbox_toolbox_api_client/models/git_status.py +118 -0
  56. cogbox_toolbox_api_client/models/initialize_request.py +102 -0
  57. cogbox_toolbox_api_client/models/interpreter_context.py +110 -0
  58. cogbox_toolbox_api_client/models/is_port_in_use_response.py +102 -0
  59. cogbox_toolbox_api_client/models/keyboard_hotkey_request.py +102 -0
  60. cogbox_toolbox_api_client/models/keyboard_press_request.py +104 -0
  61. cogbox_toolbox_api_client/models/keyboard_type_request.py +104 -0
  62. cogbox_toolbox_api_client/models/list_branch_response.py +102 -0
  63. cogbox_toolbox_api_client/models/list_contexts_response.py +110 -0
  64. cogbox_toolbox_api_client/models/list_recordings_response.py +110 -0
  65. cogbox_toolbox_api_client/models/lsp_completion_params.py +118 -0
  66. cogbox_toolbox_api_client/models/lsp_document_request.py +106 -0
  67. cogbox_toolbox_api_client/models/lsp_location.py +108 -0
  68. cogbox_toolbox_api_client/models/lsp_position.py +104 -0
  69. cogbox_toolbox_api_client/models/lsp_range.py +111 -0
  70. cogbox_toolbox_api_client/models/lsp_server_request.py +104 -0
  71. cogbox_toolbox_api_client/models/lsp_symbol.py +110 -0
  72. cogbox_toolbox_api_client/models/match.py +106 -0
  73. cogbox_toolbox_api_client/models/mouse_click_request.py +108 -0
  74. cogbox_toolbox_api_client/models/mouse_click_response.py +104 -0
  75. cogbox_toolbox_api_client/models/mouse_drag_request.py +110 -0
  76. cogbox_toolbox_api_client/models/mouse_drag_response.py +104 -0
  77. cogbox_toolbox_api_client/models/mouse_move_request.py +104 -0
  78. cogbox_toolbox_api_client/models/mouse_position_response.py +104 -0
  79. cogbox_toolbox_api_client/models/mouse_scroll_request.py +109 -0
  80. cogbox_toolbox_api_client/models/port_list.py +102 -0
  81. cogbox_toolbox_api_client/models/position.py +104 -0
  82. cogbox_toolbox_api_client/models/process_errors_response.py +104 -0
  83. cogbox_toolbox_api_client/models/process_logs_response.py +104 -0
  84. cogbox_toolbox_api_client/models/process_restart_response.py +104 -0
  85. cogbox_toolbox_api_client/models/process_status.py +108 -0
  86. cogbox_toolbox_api_client/models/process_status_response.py +104 -0
  87. cogbox_toolbox_api_client/models/pty_create_request.py +112 -0
  88. cogbox_toolbox_api_client/models/pty_create_response.py +102 -0
  89. cogbox_toolbox_api_client/models/pty_list_response.py +110 -0
  90. cogbox_toolbox_api_client/models/pty_resize_request.py +105 -0
  91. cogbox_toolbox_api_client/models/pty_session_info.py +116 -0
  92. cogbox_toolbox_api_client/models/recording.py +116 -0
  93. cogbox_toolbox_api_client/models/replace_request.py +106 -0
  94. cogbox_toolbox_api_client/models/replace_result.py +106 -0
  95. cogbox_toolbox_api_client/models/screenshot_response.py +110 -0
  96. cogbox_toolbox_api_client/models/scroll_response.py +102 -0
  97. cogbox_toolbox_api_client/models/search_files_response.py +102 -0
  98. cogbox_toolbox_api_client/models/session.py +112 -0
  99. cogbox_toolbox_api_client/models/session_command_logs_response.py +106 -0
  100. cogbox_toolbox_api_client/models/session_execute_request.py +108 -0
  101. cogbox_toolbox_api_client/models/session_execute_response.py +110 -0
  102. cogbox_toolbox_api_client/models/session_send_input_request.py +102 -0
  103. cogbox_toolbox_api_client/models/start_recording_request.py +102 -0
  104. cogbox_toolbox_api_client/models/status.py +48 -0
  105. cogbox_toolbox_api_client/models/stop_recording_request.py +102 -0
  106. cogbox_toolbox_api_client/models/user_home_dir_response.py +102 -0
  107. cogbox_toolbox_api_client/models/window_info.py +114 -0
  108. cogbox_toolbox_api_client/models/windows_response.py +110 -0
  109. cogbox_toolbox_api_client/models/work_dir_response.py +102 -0
  110. cogbox_toolbox_api_client/py.typed +0 -0
  111. cogbox_toolbox_api_client/rest.py +263 -0
  112. cogbox_toolbox_api_client-0.190.1.dist-info/METADATA +251 -0
  113. cogbox_toolbox_api_client-0.190.1.dist-info/RECORD +116 -0
  114. cogbox_toolbox_api_client-0.190.1.dist-info/WHEEL +5 -0
  115. cogbox_toolbox_api_client-0.190.1.dist-info/licenses/LICENSE +190 -0
  116. cogbox_toolbox_api_client-0.190.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3583 @@
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, StrictBool, StrictBytes, StrictStr
19
+ from typing import Any, Dict, List, Optional, Tuple, Union
20
+ from typing_extensions import Annotated
21
+ from cogbox_toolbox_api_client.models.file_info import FileInfo
22
+ from cogbox_toolbox_api_client.models.files_download_request import FilesDownloadRequest
23
+ from cogbox_toolbox_api_client.models.match import Match
24
+ from cogbox_toolbox_api_client.models.replace_request import ReplaceRequest
25
+ from cogbox_toolbox_api_client.models.replace_result import ReplaceResult
26
+ from cogbox_toolbox_api_client.models.search_files_response import SearchFilesResponse
27
+
28
+ from cogbox_toolbox_api_client.api_client import ApiClient, RequestSerialized
29
+ from cogbox_toolbox_api_client.api_response import ApiResponse
30
+ from cogbox_toolbox_api_client.rest import RESTResponseType
31
+
32
+
33
+ class FileSystemApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ def create_folder(
48
+ self,
49
+ path: Annotated[StrictStr, Field(description="Folder path to create")],
50
+ mode: Annotated[StrictStr, Field(description="Octal permission mode (default: 0755)")],
51
+ _request_timeout: Union[
52
+ None,
53
+ Annotated[StrictFloat, Field(gt=0)],
54
+ Tuple[
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Annotated[StrictFloat, Field(gt=0)]
57
+ ]
58
+ ] = None,
59
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
60
+ _content_type: Optional[StrictStr] = None,
61
+ _headers: Optional[Dict[StrictStr, Any]] = None,
62
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
63
+ ) -> None:
64
+ """Create a folder
65
+
66
+ Create a folder with the specified path and optional permissions
67
+
68
+ :param path: Folder path to create (required)
69
+ :type path: str
70
+ :param mode: Octal permission mode (default: 0755) (required)
71
+ :type mode: str
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._create_folder_serialize(
95
+ path=path,
96
+ mode=mode,
97
+ _request_auth=_request_auth,
98
+ _content_type=_content_type,
99
+ _headers=_headers,
100
+ _host_index=_host_index
101
+ )
102
+
103
+ _response_types_map: Dict[str, Optional[str]] = {
104
+ '201': None,
105
+ }
106
+ response_data = self.api_client.call_api(
107
+ *_param,
108
+ _request_timeout=_request_timeout
109
+ )
110
+ response_data.read()
111
+ return self.api_client.response_deserialize(
112
+ response_data=response_data,
113
+ response_types_map=_response_types_map,
114
+ ).data
115
+
116
+
117
+ @validate_call
118
+ def create_folder_with_http_info(
119
+ self,
120
+ path: Annotated[StrictStr, Field(description="Folder path to create")],
121
+ mode: Annotated[StrictStr, Field(description="Octal permission mode (default: 0755)")],
122
+ _request_timeout: Union[
123
+ None,
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Tuple[
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Annotated[StrictFloat, Field(gt=0)]
128
+ ]
129
+ ] = None,
130
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
+ _content_type: Optional[StrictStr] = None,
132
+ _headers: Optional[Dict[StrictStr, Any]] = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[None]:
135
+ """Create a folder
136
+
137
+ Create a folder with the specified path and optional permissions
138
+
139
+ :param path: Folder path to create (required)
140
+ :type path: str
141
+ :param mode: Octal permission mode (default: 0755) (required)
142
+ :type mode: str
143
+ :param _request_timeout: timeout setting for this request. If one
144
+ number provided, it will be total request
145
+ timeout. It can also be a pair (tuple) of
146
+ (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
162
+ :return: Returns the result object.
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_folder_serialize(
166
+ path=path,
167
+ mode=mode,
168
+ _request_auth=_request_auth,
169
+ _content_type=_content_type,
170
+ _headers=_headers,
171
+ _host_index=_host_index
172
+ )
173
+
174
+ _response_types_map: Dict[str, Optional[str]] = {
175
+ '201': None,
176
+ }
177
+ response_data = self.api_client.call_api(
178
+ *_param,
179
+ _request_timeout=_request_timeout
180
+ )
181
+ response_data.read()
182
+ return self.api_client.response_deserialize(
183
+ response_data=response_data,
184
+ response_types_map=_response_types_map,
185
+ )
186
+
187
+
188
+ @validate_call
189
+ def create_folder_without_preload_content(
190
+ self,
191
+ path: Annotated[StrictStr, Field(description="Folder path to create")],
192
+ mode: Annotated[StrictStr, Field(description="Octal permission mode (default: 0755)")],
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Create a folder
207
+
208
+ Create a folder with the specified path and optional permissions
209
+
210
+ :param path: Folder path to create (required)
211
+ :type path: str
212
+ :param mode: Octal permission mode (default: 0755) (required)
213
+ :type mode: str
214
+ :param _request_timeout: timeout setting for this request. If one
215
+ number provided, it will be total request
216
+ timeout. It can also be a pair (tuple) of
217
+ (connection, read) timeouts.
218
+ :type _request_timeout: int, tuple(int, int), optional
219
+ :param _request_auth: set to override the auth_settings for an a single
220
+ request; this effectively ignores the
221
+ authentication in the spec for a single request.
222
+ :type _request_auth: dict, optional
223
+ :param _content_type: force content-type for the request.
224
+ :type _content_type: str, Optional
225
+ :param _headers: set to override the headers for a single
226
+ request; this effectively ignores the headers
227
+ in the spec for a single request.
228
+ :type _headers: dict, optional
229
+ :param _host_index: set to override the host_index for a single
230
+ request; this effectively ignores the host_index
231
+ in the spec for a single request.
232
+ :type _host_index: int, optional
233
+ :return: Returns the result object.
234
+ """ # noqa: E501
235
+
236
+ _param = self._create_folder_serialize(
237
+ path=path,
238
+ mode=mode,
239
+ _request_auth=_request_auth,
240
+ _content_type=_content_type,
241
+ _headers=_headers,
242
+ _host_index=_host_index
243
+ )
244
+
245
+ _response_types_map: Dict[str, Optional[str]] = {
246
+ '201': None,
247
+ }
248
+ response_data = self.api_client.call_api(
249
+ *_param,
250
+ _request_timeout=_request_timeout
251
+ )
252
+ return response_data.response
253
+
254
+
255
+ def _create_folder_serialize(
256
+ self,
257
+ path,
258
+ mode,
259
+ _request_auth,
260
+ _content_type,
261
+ _headers,
262
+ _host_index,
263
+ ) -> RequestSerialized:
264
+
265
+ _host = None
266
+
267
+ _collection_formats: Dict[str, str] = {
268
+ }
269
+
270
+ _path_params: Dict[str, str] = {}
271
+ _query_params: List[Tuple[str, str]] = []
272
+ _header_params: Dict[str, Optional[str]] = _headers or {}
273
+ _form_params: List[Tuple[str, str]] = []
274
+ _files: Dict[
275
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
276
+ ] = {}
277
+ _body_params: Optional[bytes] = None
278
+
279
+ # process the path parameters
280
+ # process the query parameters
281
+ if path is not None:
282
+
283
+ _query_params.append(('path', path))
284
+
285
+ if mode is not None:
286
+
287
+ _query_params.append(('mode', mode))
288
+
289
+ # process the header parameters
290
+ # process the form parameters
291
+ # process the body parameter
292
+
293
+
294
+
295
+
296
+ # authentication setting
297
+ _auth_settings: List[str] = [
298
+ ]
299
+
300
+ return self.api_client.param_serialize(
301
+ method='POST',
302
+ resource_path='/files/folder',
303
+ path_params=_path_params,
304
+ query_params=_query_params,
305
+ header_params=_header_params,
306
+ body=_body_params,
307
+ post_params=_form_params,
308
+ files=_files,
309
+ auth_settings=_auth_settings,
310
+ collection_formats=_collection_formats,
311
+ _host=_host,
312
+ _request_auth=_request_auth
313
+ )
314
+
315
+
316
+
317
+
318
+ @validate_call
319
+ def delete_file(
320
+ self,
321
+ path: Annotated[StrictStr, Field(description="File or directory path to delete")],
322
+ recursive: Annotated[Optional[StrictBool], Field(description="Enable recursive deletion for directories")] = None,
323
+ _request_timeout: Union[
324
+ None,
325
+ Annotated[StrictFloat, Field(gt=0)],
326
+ Tuple[
327
+ Annotated[StrictFloat, Field(gt=0)],
328
+ Annotated[StrictFloat, Field(gt=0)]
329
+ ]
330
+ ] = None,
331
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
332
+ _content_type: Optional[StrictStr] = None,
333
+ _headers: Optional[Dict[StrictStr, Any]] = None,
334
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
335
+ ) -> None:
336
+ """Delete a file or directory
337
+
338
+ Delete a file or directory at the specified path
339
+
340
+ :param path: File or directory path to delete (required)
341
+ :type path: str
342
+ :param recursive: Enable recursive deletion for directories
343
+ :type recursive: bool
344
+ :param _request_timeout: timeout setting for this request. If one
345
+ number provided, it will be total request
346
+ timeout. It can also be a pair (tuple) of
347
+ (connection, read) timeouts.
348
+ :type _request_timeout: int, tuple(int, int), optional
349
+ :param _request_auth: set to override the auth_settings for an a single
350
+ request; this effectively ignores the
351
+ authentication in the spec for a single request.
352
+ :type _request_auth: dict, optional
353
+ :param _content_type: force content-type for the request.
354
+ :type _content_type: str, Optional
355
+ :param _headers: set to override the headers for a single
356
+ request; this effectively ignores the headers
357
+ in the spec for a single request.
358
+ :type _headers: dict, optional
359
+ :param _host_index: set to override the host_index for a single
360
+ request; this effectively ignores the host_index
361
+ in the spec for a single request.
362
+ :type _host_index: int, optional
363
+ :return: Returns the result object.
364
+ """ # noqa: E501
365
+
366
+ _param = self._delete_file_serialize(
367
+ path=path,
368
+ recursive=recursive,
369
+ _request_auth=_request_auth,
370
+ _content_type=_content_type,
371
+ _headers=_headers,
372
+ _host_index=_host_index
373
+ )
374
+
375
+ _response_types_map: Dict[str, Optional[str]] = {
376
+ '204': None,
377
+ }
378
+ response_data = self.api_client.call_api(
379
+ *_param,
380
+ _request_timeout=_request_timeout
381
+ )
382
+ response_data.read()
383
+ return self.api_client.response_deserialize(
384
+ response_data=response_data,
385
+ response_types_map=_response_types_map,
386
+ ).data
387
+
388
+
389
+ @validate_call
390
+ def delete_file_with_http_info(
391
+ self,
392
+ path: Annotated[StrictStr, Field(description="File or directory path to delete")],
393
+ recursive: Annotated[Optional[StrictBool], Field(description="Enable recursive deletion for directories")] = None,
394
+ _request_timeout: Union[
395
+ None,
396
+ Annotated[StrictFloat, Field(gt=0)],
397
+ Tuple[
398
+ Annotated[StrictFloat, Field(gt=0)],
399
+ Annotated[StrictFloat, Field(gt=0)]
400
+ ]
401
+ ] = None,
402
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
403
+ _content_type: Optional[StrictStr] = None,
404
+ _headers: Optional[Dict[StrictStr, Any]] = None,
405
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
406
+ ) -> ApiResponse[None]:
407
+ """Delete a file or directory
408
+
409
+ Delete a file or directory at the specified path
410
+
411
+ :param path: File or directory path to delete (required)
412
+ :type path: str
413
+ :param recursive: Enable recursive deletion for directories
414
+ :type recursive: bool
415
+ :param _request_timeout: timeout setting for this request. If one
416
+ number provided, it will be total request
417
+ timeout. It can also be a pair (tuple) of
418
+ (connection, read) timeouts.
419
+ :type _request_timeout: int, tuple(int, int), optional
420
+ :param _request_auth: set to override the auth_settings for an a single
421
+ request; this effectively ignores the
422
+ authentication in the spec for a single request.
423
+ :type _request_auth: dict, optional
424
+ :param _content_type: force content-type for the request.
425
+ :type _content_type: str, Optional
426
+ :param _headers: set to override the headers for a single
427
+ request; this effectively ignores the headers
428
+ in the spec for a single request.
429
+ :type _headers: dict, optional
430
+ :param _host_index: set to override the host_index for a single
431
+ request; this effectively ignores the host_index
432
+ in the spec for a single request.
433
+ :type _host_index: int, optional
434
+ :return: Returns the result object.
435
+ """ # noqa: E501
436
+
437
+ _param = self._delete_file_serialize(
438
+ path=path,
439
+ recursive=recursive,
440
+ _request_auth=_request_auth,
441
+ _content_type=_content_type,
442
+ _headers=_headers,
443
+ _host_index=_host_index
444
+ )
445
+
446
+ _response_types_map: Dict[str, Optional[str]] = {
447
+ '204': None,
448
+ }
449
+ response_data = self.api_client.call_api(
450
+ *_param,
451
+ _request_timeout=_request_timeout
452
+ )
453
+ response_data.read()
454
+ return self.api_client.response_deserialize(
455
+ response_data=response_data,
456
+ response_types_map=_response_types_map,
457
+ )
458
+
459
+
460
+ @validate_call
461
+ def delete_file_without_preload_content(
462
+ self,
463
+ path: Annotated[StrictStr, Field(description="File or directory path to delete")],
464
+ recursive: Annotated[Optional[StrictBool], Field(description="Enable recursive deletion for directories")] = None,
465
+ _request_timeout: Union[
466
+ None,
467
+ Annotated[StrictFloat, Field(gt=0)],
468
+ Tuple[
469
+ Annotated[StrictFloat, Field(gt=0)],
470
+ Annotated[StrictFloat, Field(gt=0)]
471
+ ]
472
+ ] = None,
473
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
474
+ _content_type: Optional[StrictStr] = None,
475
+ _headers: Optional[Dict[StrictStr, Any]] = None,
476
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
477
+ ) -> RESTResponseType:
478
+ """Delete a file or directory
479
+
480
+ Delete a file or directory at the specified path
481
+
482
+ :param path: File or directory path to delete (required)
483
+ :type path: str
484
+ :param recursive: Enable recursive deletion for directories
485
+ :type recursive: bool
486
+ :param _request_timeout: timeout setting for this request. If one
487
+ number provided, it will be total request
488
+ timeout. It can also be a pair (tuple) of
489
+ (connection, read) timeouts.
490
+ :type _request_timeout: int, tuple(int, int), optional
491
+ :param _request_auth: set to override the auth_settings for an a single
492
+ request; this effectively ignores the
493
+ authentication in the spec for a single request.
494
+ :type _request_auth: dict, optional
495
+ :param _content_type: force content-type for the request.
496
+ :type _content_type: str, Optional
497
+ :param _headers: set to override the headers for a single
498
+ request; this effectively ignores the headers
499
+ in the spec for a single request.
500
+ :type _headers: dict, optional
501
+ :param _host_index: set to override the host_index for a single
502
+ request; this effectively ignores the host_index
503
+ in the spec for a single request.
504
+ :type _host_index: int, optional
505
+ :return: Returns the result object.
506
+ """ # noqa: E501
507
+
508
+ _param = self._delete_file_serialize(
509
+ path=path,
510
+ recursive=recursive,
511
+ _request_auth=_request_auth,
512
+ _content_type=_content_type,
513
+ _headers=_headers,
514
+ _host_index=_host_index
515
+ )
516
+
517
+ _response_types_map: Dict[str, Optional[str]] = {
518
+ '204': None,
519
+ }
520
+ response_data = self.api_client.call_api(
521
+ *_param,
522
+ _request_timeout=_request_timeout
523
+ )
524
+ return response_data.response
525
+
526
+
527
+ def _delete_file_serialize(
528
+ self,
529
+ path,
530
+ recursive,
531
+ _request_auth,
532
+ _content_type,
533
+ _headers,
534
+ _host_index,
535
+ ) -> RequestSerialized:
536
+
537
+ _host = None
538
+
539
+ _collection_formats: Dict[str, str] = {
540
+ }
541
+
542
+ _path_params: Dict[str, str] = {}
543
+ _query_params: List[Tuple[str, str]] = []
544
+ _header_params: Dict[str, Optional[str]] = _headers or {}
545
+ _form_params: List[Tuple[str, str]] = []
546
+ _files: Dict[
547
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
548
+ ] = {}
549
+ _body_params: Optional[bytes] = None
550
+
551
+ # process the path parameters
552
+ # process the query parameters
553
+ if path is not None:
554
+
555
+ _query_params.append(('path', path))
556
+
557
+ if recursive is not None:
558
+
559
+ _query_params.append(('recursive', recursive))
560
+
561
+ # process the header parameters
562
+ # process the form parameters
563
+ # process the body parameter
564
+
565
+
566
+
567
+
568
+ # authentication setting
569
+ _auth_settings: List[str] = [
570
+ ]
571
+
572
+ return self.api_client.param_serialize(
573
+ method='DELETE',
574
+ resource_path='/files',
575
+ path_params=_path_params,
576
+ query_params=_query_params,
577
+ header_params=_header_params,
578
+ body=_body_params,
579
+ post_params=_form_params,
580
+ files=_files,
581
+ auth_settings=_auth_settings,
582
+ collection_formats=_collection_formats,
583
+ _host=_host,
584
+ _request_auth=_request_auth
585
+ )
586
+
587
+
588
+
589
+
590
+ @validate_call
591
+ def download_file(
592
+ self,
593
+ path: Annotated[StrictStr, Field(description="File path to download")],
594
+ _request_timeout: Union[
595
+ None,
596
+ Annotated[StrictFloat, Field(gt=0)],
597
+ Tuple[
598
+ Annotated[StrictFloat, Field(gt=0)],
599
+ Annotated[StrictFloat, Field(gt=0)]
600
+ ]
601
+ ] = None,
602
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
603
+ _content_type: Optional[StrictStr] = None,
604
+ _headers: Optional[Dict[StrictStr, Any]] = None,
605
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
606
+ ) -> bytes:
607
+ """Download a file
608
+
609
+ Download a file by providing its path
610
+
611
+ :param path: File path to download (required)
612
+ :type path: str
613
+ :param _request_timeout: timeout setting for this request. If one
614
+ number provided, it will be total request
615
+ timeout. It can also be a pair (tuple) of
616
+ (connection, read) timeouts.
617
+ :type _request_timeout: int, tuple(int, int), optional
618
+ :param _request_auth: set to override the auth_settings for an a single
619
+ request; this effectively ignores the
620
+ authentication in the spec for a single request.
621
+ :type _request_auth: dict, optional
622
+ :param _content_type: force content-type for the request.
623
+ :type _content_type: str, Optional
624
+ :param _headers: set to override the headers for a single
625
+ request; this effectively ignores the headers
626
+ in the spec for a single request.
627
+ :type _headers: dict, optional
628
+ :param _host_index: set to override the host_index for a single
629
+ request; this effectively ignores the host_index
630
+ in the spec for a single request.
631
+ :type _host_index: int, optional
632
+ :return: Returns the result object.
633
+ """ # noqa: E501
634
+
635
+ _param = self._download_file_serialize(
636
+ path=path,
637
+ _request_auth=_request_auth,
638
+ _content_type=_content_type,
639
+ _headers=_headers,
640
+ _host_index=_host_index
641
+ )
642
+
643
+ _response_types_map: Dict[str, Optional[str]] = {
644
+ '200': "bytes",
645
+ }
646
+ response_data = self.api_client.call_api(
647
+ *_param,
648
+ _request_timeout=_request_timeout
649
+ )
650
+ response_data.read()
651
+ return self.api_client.response_deserialize(
652
+ response_data=response_data,
653
+ response_types_map=_response_types_map,
654
+ ).data
655
+
656
+
657
+ @validate_call
658
+ def download_file_with_http_info(
659
+ self,
660
+ path: Annotated[StrictStr, Field(description="File path to download")],
661
+ _request_timeout: Union[
662
+ None,
663
+ Annotated[StrictFloat, Field(gt=0)],
664
+ Tuple[
665
+ Annotated[StrictFloat, Field(gt=0)],
666
+ Annotated[StrictFloat, Field(gt=0)]
667
+ ]
668
+ ] = None,
669
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
670
+ _content_type: Optional[StrictStr] = None,
671
+ _headers: Optional[Dict[StrictStr, Any]] = None,
672
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
673
+ ) -> ApiResponse[bytes]:
674
+ """Download a file
675
+
676
+ Download a file by providing its path
677
+
678
+ :param path: File path to download (required)
679
+ :type path: str
680
+ :param _request_timeout: timeout setting for this request. If one
681
+ number provided, it will be total request
682
+ timeout. It can also be a pair (tuple) of
683
+ (connection, read) timeouts.
684
+ :type _request_timeout: int, tuple(int, int), optional
685
+ :param _request_auth: set to override the auth_settings for an a single
686
+ request; this effectively ignores the
687
+ authentication in the spec for a single request.
688
+ :type _request_auth: dict, optional
689
+ :param _content_type: force content-type for the request.
690
+ :type _content_type: str, Optional
691
+ :param _headers: set to override the headers for a single
692
+ request; this effectively ignores the headers
693
+ in the spec for a single request.
694
+ :type _headers: dict, optional
695
+ :param _host_index: set to override the host_index for a single
696
+ request; this effectively ignores the host_index
697
+ in the spec for a single request.
698
+ :type _host_index: int, optional
699
+ :return: Returns the result object.
700
+ """ # noqa: E501
701
+
702
+ _param = self._download_file_serialize(
703
+ path=path,
704
+ _request_auth=_request_auth,
705
+ _content_type=_content_type,
706
+ _headers=_headers,
707
+ _host_index=_host_index
708
+ )
709
+
710
+ _response_types_map: Dict[str, Optional[str]] = {
711
+ '200': "bytes",
712
+ }
713
+ response_data = self.api_client.call_api(
714
+ *_param,
715
+ _request_timeout=_request_timeout
716
+ )
717
+ response_data.read()
718
+ return self.api_client.response_deserialize(
719
+ response_data=response_data,
720
+ response_types_map=_response_types_map,
721
+ )
722
+
723
+
724
+ @validate_call
725
+ def download_file_without_preload_content(
726
+ self,
727
+ path: Annotated[StrictStr, Field(description="File path to download")],
728
+ _request_timeout: Union[
729
+ None,
730
+ Annotated[StrictFloat, Field(gt=0)],
731
+ Tuple[
732
+ Annotated[StrictFloat, Field(gt=0)],
733
+ Annotated[StrictFloat, Field(gt=0)]
734
+ ]
735
+ ] = None,
736
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
737
+ _content_type: Optional[StrictStr] = None,
738
+ _headers: Optional[Dict[StrictStr, Any]] = None,
739
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
740
+ ) -> RESTResponseType:
741
+ """Download a file
742
+
743
+ Download a file by providing its path
744
+
745
+ :param path: File path to download (required)
746
+ :type path: str
747
+ :param _request_timeout: timeout setting for this request. If one
748
+ number provided, it will be total request
749
+ timeout. It can also be a pair (tuple) of
750
+ (connection, read) timeouts.
751
+ :type _request_timeout: int, tuple(int, int), optional
752
+ :param _request_auth: set to override the auth_settings for an a single
753
+ request; this effectively ignores the
754
+ authentication in the spec for a single request.
755
+ :type _request_auth: dict, optional
756
+ :param _content_type: force content-type for the request.
757
+ :type _content_type: str, Optional
758
+ :param _headers: set to override the headers for a single
759
+ request; this effectively ignores the headers
760
+ in the spec for a single request.
761
+ :type _headers: dict, optional
762
+ :param _host_index: set to override the host_index for a single
763
+ request; this effectively ignores the host_index
764
+ in the spec for a single request.
765
+ :type _host_index: int, optional
766
+ :return: Returns the result object.
767
+ """ # noqa: E501
768
+
769
+ _param = self._download_file_serialize(
770
+ path=path,
771
+ _request_auth=_request_auth,
772
+ _content_type=_content_type,
773
+ _headers=_headers,
774
+ _host_index=_host_index
775
+ )
776
+
777
+ _response_types_map: Dict[str, Optional[str]] = {
778
+ '200': "bytes",
779
+ }
780
+ response_data = self.api_client.call_api(
781
+ *_param,
782
+ _request_timeout=_request_timeout
783
+ )
784
+ return response_data.response
785
+
786
+
787
+ def _download_file_serialize(
788
+ self,
789
+ path,
790
+ _request_auth,
791
+ _content_type,
792
+ _headers,
793
+ _host_index,
794
+ ) -> RequestSerialized:
795
+
796
+ _host = None
797
+
798
+ _collection_formats: Dict[str, str] = {
799
+ }
800
+
801
+ _path_params: Dict[str, str] = {}
802
+ _query_params: List[Tuple[str, str]] = []
803
+ _header_params: Dict[str, Optional[str]] = _headers or {}
804
+ _form_params: List[Tuple[str, str]] = []
805
+ _files: Dict[
806
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
807
+ ] = {}
808
+ _body_params: Optional[bytes] = None
809
+
810
+ # process the path parameters
811
+ # process the query parameters
812
+ if path is not None:
813
+
814
+ _query_params.append(('path', path))
815
+
816
+ # process the header parameters
817
+ # process the form parameters
818
+ # process the body parameter
819
+
820
+
821
+ # set the HTTP header `Accept`
822
+ if 'Accept' not in _header_params:
823
+ _header_params['Accept'] = self.api_client.select_header_accept(
824
+ [
825
+ 'application/octet-stream'
826
+ ]
827
+ )
828
+
829
+
830
+ # authentication setting
831
+ _auth_settings: List[str] = [
832
+ ]
833
+
834
+ return self.api_client.param_serialize(
835
+ method='GET',
836
+ resource_path='/files/download',
837
+ path_params=_path_params,
838
+ query_params=_query_params,
839
+ header_params=_header_params,
840
+ body=_body_params,
841
+ post_params=_form_params,
842
+ files=_files,
843
+ auth_settings=_auth_settings,
844
+ collection_formats=_collection_formats,
845
+ _host=_host,
846
+ _request_auth=_request_auth
847
+ )
848
+
849
+
850
+
851
+
852
+ @validate_call
853
+ def download_files(
854
+ self,
855
+ download_files: Annotated[FilesDownloadRequest, Field(description="Paths of files to download")],
856
+ _request_timeout: Union[
857
+ None,
858
+ Annotated[StrictFloat, Field(gt=0)],
859
+ Tuple[
860
+ Annotated[StrictFloat, Field(gt=0)],
861
+ Annotated[StrictFloat, Field(gt=0)]
862
+ ]
863
+ ] = None,
864
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
865
+ _content_type: Optional[StrictStr] = None,
866
+ _headers: Optional[Dict[StrictStr, Any]] = None,
867
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
868
+ ) -> Dict[str, object]:
869
+ """Download multiple files
870
+
871
+ Download multiple files by providing their paths. Successful files are returned as multipart parts named `file`. Per-file failures are returned as multipart parts named `error` with JSON payloads shaped like ErrorResponse.
872
+
873
+ :param download_files: Paths of files to download (required)
874
+ :type download_files: FilesDownloadRequest
875
+ :param _request_timeout: timeout setting for this request. If one
876
+ number provided, it will be total request
877
+ timeout. It can also be a pair (tuple) of
878
+ (connection, read) timeouts.
879
+ :type _request_timeout: int, tuple(int, int), optional
880
+ :param _request_auth: set to override the auth_settings for an a single
881
+ request; this effectively ignores the
882
+ authentication in the spec for a single request.
883
+ :type _request_auth: dict, optional
884
+ :param _content_type: force content-type for the request.
885
+ :type _content_type: str, Optional
886
+ :param _headers: set to override the headers for a single
887
+ request; this effectively ignores the headers
888
+ in the spec for a single request.
889
+ :type _headers: dict, optional
890
+ :param _host_index: set to override the host_index for a single
891
+ request; this effectively ignores the host_index
892
+ in the spec for a single request.
893
+ :type _host_index: int, optional
894
+ :return: Returns the result object.
895
+ """ # noqa: E501
896
+
897
+ _param = self._download_files_serialize(
898
+ download_files=download_files,
899
+ _request_auth=_request_auth,
900
+ _content_type=_content_type,
901
+ _headers=_headers,
902
+ _host_index=_host_index
903
+ )
904
+
905
+ _response_types_map: Dict[str, Optional[str]] = {
906
+ '200': "Dict[str, object]",
907
+ }
908
+ response_data = self.api_client.call_api(
909
+ *_param,
910
+ _request_timeout=_request_timeout
911
+ )
912
+ response_data.read()
913
+ return self.api_client.response_deserialize(
914
+ response_data=response_data,
915
+ response_types_map=_response_types_map,
916
+ ).data
917
+
918
+
919
+ @validate_call
920
+ def download_files_with_http_info(
921
+ self,
922
+ download_files: Annotated[FilesDownloadRequest, Field(description="Paths of files to download")],
923
+ _request_timeout: Union[
924
+ None,
925
+ Annotated[StrictFloat, Field(gt=0)],
926
+ Tuple[
927
+ Annotated[StrictFloat, Field(gt=0)],
928
+ Annotated[StrictFloat, Field(gt=0)]
929
+ ]
930
+ ] = None,
931
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
932
+ _content_type: Optional[StrictStr] = None,
933
+ _headers: Optional[Dict[StrictStr, Any]] = None,
934
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
935
+ ) -> ApiResponse[Dict[str, object]]:
936
+ """Download multiple files
937
+
938
+ Download multiple files by providing their paths. Successful files are returned as multipart parts named `file`. Per-file failures are returned as multipart parts named `error` with JSON payloads shaped like ErrorResponse.
939
+
940
+ :param download_files: Paths of files to download (required)
941
+ :type download_files: FilesDownloadRequest
942
+ :param _request_timeout: timeout setting for this request. If one
943
+ number provided, it will be total request
944
+ timeout. It can also be a pair (tuple) of
945
+ (connection, read) timeouts.
946
+ :type _request_timeout: int, tuple(int, int), optional
947
+ :param _request_auth: set to override the auth_settings for an a single
948
+ request; this effectively ignores the
949
+ authentication in the spec for a single request.
950
+ :type _request_auth: dict, optional
951
+ :param _content_type: force content-type for the request.
952
+ :type _content_type: str, Optional
953
+ :param _headers: set to override the headers for a single
954
+ request; this effectively ignores the headers
955
+ in the spec for a single request.
956
+ :type _headers: dict, optional
957
+ :param _host_index: set to override the host_index for a single
958
+ request; this effectively ignores the host_index
959
+ in the spec for a single request.
960
+ :type _host_index: int, optional
961
+ :return: Returns the result object.
962
+ """ # noqa: E501
963
+
964
+ _param = self._download_files_serialize(
965
+ download_files=download_files,
966
+ _request_auth=_request_auth,
967
+ _content_type=_content_type,
968
+ _headers=_headers,
969
+ _host_index=_host_index
970
+ )
971
+
972
+ _response_types_map: Dict[str, Optional[str]] = {
973
+ '200': "Dict[str, object]",
974
+ }
975
+ response_data = self.api_client.call_api(
976
+ *_param,
977
+ _request_timeout=_request_timeout
978
+ )
979
+ response_data.read()
980
+ return self.api_client.response_deserialize(
981
+ response_data=response_data,
982
+ response_types_map=_response_types_map,
983
+ )
984
+
985
+
986
+ @validate_call
987
+ def download_files_without_preload_content(
988
+ self,
989
+ download_files: Annotated[FilesDownloadRequest, Field(description="Paths of files to download")],
990
+ _request_timeout: Union[
991
+ None,
992
+ Annotated[StrictFloat, Field(gt=0)],
993
+ Tuple[
994
+ Annotated[StrictFloat, Field(gt=0)],
995
+ Annotated[StrictFloat, Field(gt=0)]
996
+ ]
997
+ ] = None,
998
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
999
+ _content_type: Optional[StrictStr] = None,
1000
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1001
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1002
+ ) -> RESTResponseType:
1003
+ """Download multiple files
1004
+
1005
+ Download multiple files by providing their paths. Successful files are returned as multipart parts named `file`. Per-file failures are returned as multipart parts named `error` with JSON payloads shaped like ErrorResponse.
1006
+
1007
+ :param download_files: Paths of files to download (required)
1008
+ :type download_files: FilesDownloadRequest
1009
+ :param _request_timeout: timeout setting for this request. If one
1010
+ number provided, it will be total request
1011
+ timeout. It can also be a pair (tuple) of
1012
+ (connection, read) timeouts.
1013
+ :type _request_timeout: int, tuple(int, int), optional
1014
+ :param _request_auth: set to override the auth_settings for an a single
1015
+ request; this effectively ignores the
1016
+ authentication in the spec for a single request.
1017
+ :type _request_auth: dict, optional
1018
+ :param _content_type: force content-type for the request.
1019
+ :type _content_type: str, Optional
1020
+ :param _headers: set to override the headers for a single
1021
+ request; this effectively ignores the headers
1022
+ in the spec for a single request.
1023
+ :type _headers: dict, optional
1024
+ :param _host_index: set to override the host_index for a single
1025
+ request; this effectively ignores the host_index
1026
+ in the spec for a single request.
1027
+ :type _host_index: int, optional
1028
+ :return: Returns the result object.
1029
+ """ # noqa: E501
1030
+
1031
+ _param = self._download_files_serialize(
1032
+ download_files=download_files,
1033
+ _request_auth=_request_auth,
1034
+ _content_type=_content_type,
1035
+ _headers=_headers,
1036
+ _host_index=_host_index
1037
+ )
1038
+
1039
+ _response_types_map: Dict[str, Optional[str]] = {
1040
+ '200': "Dict[str, object]",
1041
+ }
1042
+ response_data = self.api_client.call_api(
1043
+ *_param,
1044
+ _request_timeout=_request_timeout
1045
+ )
1046
+ return response_data.response
1047
+
1048
+
1049
+ def _download_files_serialize(
1050
+ self,
1051
+ download_files,
1052
+ _request_auth,
1053
+ _content_type,
1054
+ _headers,
1055
+ _host_index,
1056
+ ) -> RequestSerialized:
1057
+
1058
+ _host = None
1059
+
1060
+ _collection_formats: Dict[str, str] = {
1061
+ }
1062
+
1063
+ _path_params: Dict[str, str] = {}
1064
+ _query_params: List[Tuple[str, str]] = []
1065
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1066
+ _form_params: List[Tuple[str, str]] = []
1067
+ _files: Dict[
1068
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1069
+ ] = {}
1070
+ _body_params: Optional[bytes] = None
1071
+
1072
+ # process the path parameters
1073
+ # process the query parameters
1074
+ # process the header parameters
1075
+ # process the form parameters
1076
+ # process the body parameter
1077
+ if download_files is not None:
1078
+ _body_params = download_files
1079
+
1080
+
1081
+ # set the HTTP header `Accept`
1082
+ if 'Accept' not in _header_params:
1083
+ _header_params['Accept'] = self.api_client.select_header_accept(
1084
+ [
1085
+ 'multipart/form-data'
1086
+ ]
1087
+ )
1088
+
1089
+ # set the HTTP header `Content-Type`
1090
+ if _content_type:
1091
+ _header_params['Content-Type'] = _content_type
1092
+ else:
1093
+ _default_content_type = (
1094
+ self.api_client.select_header_content_type(
1095
+ [
1096
+ 'application/json'
1097
+ ]
1098
+ )
1099
+ )
1100
+ if _default_content_type is not None:
1101
+ _header_params['Content-Type'] = _default_content_type
1102
+
1103
+ # authentication setting
1104
+ _auth_settings: List[str] = [
1105
+ ]
1106
+
1107
+ return self.api_client.param_serialize(
1108
+ method='POST',
1109
+ resource_path='/files/bulk-download',
1110
+ path_params=_path_params,
1111
+ query_params=_query_params,
1112
+ header_params=_header_params,
1113
+ body=_body_params,
1114
+ post_params=_form_params,
1115
+ files=_files,
1116
+ auth_settings=_auth_settings,
1117
+ collection_formats=_collection_formats,
1118
+ _host=_host,
1119
+ _request_auth=_request_auth
1120
+ )
1121
+
1122
+
1123
+
1124
+
1125
+ @validate_call
1126
+ def find_in_files(
1127
+ self,
1128
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
1129
+ pattern: Annotated[StrictStr, Field(description="Text pattern to search for")],
1130
+ _request_timeout: Union[
1131
+ None,
1132
+ Annotated[StrictFloat, Field(gt=0)],
1133
+ Tuple[
1134
+ Annotated[StrictFloat, Field(gt=0)],
1135
+ Annotated[StrictFloat, Field(gt=0)]
1136
+ ]
1137
+ ] = None,
1138
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1139
+ _content_type: Optional[StrictStr] = None,
1140
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1141
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1142
+ ) -> List[Match]:
1143
+ """Find text in files
1144
+
1145
+ Search for text pattern within files in a directory
1146
+
1147
+ :param path: Directory path to search in (required)
1148
+ :type path: str
1149
+ :param pattern: Text pattern to search for (required)
1150
+ :type pattern: str
1151
+ :param _request_timeout: timeout setting for this request. If one
1152
+ number provided, it will be total request
1153
+ timeout. It can also be a pair (tuple) of
1154
+ (connection, read) timeouts.
1155
+ :type _request_timeout: int, tuple(int, int), optional
1156
+ :param _request_auth: set to override the auth_settings for an a single
1157
+ request; this effectively ignores the
1158
+ authentication in the spec for a single request.
1159
+ :type _request_auth: dict, optional
1160
+ :param _content_type: force content-type for the request.
1161
+ :type _content_type: str, Optional
1162
+ :param _headers: set to override the headers for a single
1163
+ request; this effectively ignores the headers
1164
+ in the spec for a single request.
1165
+ :type _headers: dict, optional
1166
+ :param _host_index: set to override the host_index for a single
1167
+ request; this effectively ignores the host_index
1168
+ in the spec for a single request.
1169
+ :type _host_index: int, optional
1170
+ :return: Returns the result object.
1171
+ """ # noqa: E501
1172
+
1173
+ _param = self._find_in_files_serialize(
1174
+ path=path,
1175
+ pattern=pattern,
1176
+ _request_auth=_request_auth,
1177
+ _content_type=_content_type,
1178
+ _headers=_headers,
1179
+ _host_index=_host_index
1180
+ )
1181
+
1182
+ _response_types_map: Dict[str, Optional[str]] = {
1183
+ '200': "List[Match]",
1184
+ }
1185
+ response_data = self.api_client.call_api(
1186
+ *_param,
1187
+ _request_timeout=_request_timeout
1188
+ )
1189
+ response_data.read()
1190
+ return self.api_client.response_deserialize(
1191
+ response_data=response_data,
1192
+ response_types_map=_response_types_map,
1193
+ ).data
1194
+
1195
+
1196
+ @validate_call
1197
+ def find_in_files_with_http_info(
1198
+ self,
1199
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
1200
+ pattern: Annotated[StrictStr, Field(description="Text pattern to search for")],
1201
+ _request_timeout: Union[
1202
+ None,
1203
+ Annotated[StrictFloat, Field(gt=0)],
1204
+ Tuple[
1205
+ Annotated[StrictFloat, Field(gt=0)],
1206
+ Annotated[StrictFloat, Field(gt=0)]
1207
+ ]
1208
+ ] = None,
1209
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1210
+ _content_type: Optional[StrictStr] = None,
1211
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1212
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1213
+ ) -> ApiResponse[List[Match]]:
1214
+ """Find text in files
1215
+
1216
+ Search for text pattern within files in a directory
1217
+
1218
+ :param path: Directory path to search in (required)
1219
+ :type path: str
1220
+ :param pattern: Text pattern to search for (required)
1221
+ :type pattern: str
1222
+ :param _request_timeout: timeout setting for this request. If one
1223
+ number provided, it will be total request
1224
+ timeout. It can also be a pair (tuple) of
1225
+ (connection, read) timeouts.
1226
+ :type _request_timeout: int, tuple(int, int), optional
1227
+ :param _request_auth: set to override the auth_settings for an a single
1228
+ request; this effectively ignores the
1229
+ authentication in the spec for a single request.
1230
+ :type _request_auth: dict, optional
1231
+ :param _content_type: force content-type for the request.
1232
+ :type _content_type: str, Optional
1233
+ :param _headers: set to override the headers for a single
1234
+ request; this effectively ignores the headers
1235
+ in the spec for a single request.
1236
+ :type _headers: dict, optional
1237
+ :param _host_index: set to override the host_index for a single
1238
+ request; this effectively ignores the host_index
1239
+ in the spec for a single request.
1240
+ :type _host_index: int, optional
1241
+ :return: Returns the result object.
1242
+ """ # noqa: E501
1243
+
1244
+ _param = self._find_in_files_serialize(
1245
+ path=path,
1246
+ pattern=pattern,
1247
+ _request_auth=_request_auth,
1248
+ _content_type=_content_type,
1249
+ _headers=_headers,
1250
+ _host_index=_host_index
1251
+ )
1252
+
1253
+ _response_types_map: Dict[str, Optional[str]] = {
1254
+ '200': "List[Match]",
1255
+ }
1256
+ response_data = self.api_client.call_api(
1257
+ *_param,
1258
+ _request_timeout=_request_timeout
1259
+ )
1260
+ response_data.read()
1261
+ return self.api_client.response_deserialize(
1262
+ response_data=response_data,
1263
+ response_types_map=_response_types_map,
1264
+ )
1265
+
1266
+
1267
+ @validate_call
1268
+ def find_in_files_without_preload_content(
1269
+ self,
1270
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
1271
+ pattern: Annotated[StrictStr, Field(description="Text pattern to search for")],
1272
+ _request_timeout: Union[
1273
+ None,
1274
+ Annotated[StrictFloat, Field(gt=0)],
1275
+ Tuple[
1276
+ Annotated[StrictFloat, Field(gt=0)],
1277
+ Annotated[StrictFloat, Field(gt=0)]
1278
+ ]
1279
+ ] = None,
1280
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1281
+ _content_type: Optional[StrictStr] = None,
1282
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1283
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1284
+ ) -> RESTResponseType:
1285
+ """Find text in files
1286
+
1287
+ Search for text pattern within files in a directory
1288
+
1289
+ :param path: Directory path to search in (required)
1290
+ :type path: str
1291
+ :param pattern: Text pattern to search for (required)
1292
+ :type pattern: str
1293
+ :param _request_timeout: timeout setting for this request. If one
1294
+ number provided, it will be total request
1295
+ timeout. It can also be a pair (tuple) of
1296
+ (connection, read) timeouts.
1297
+ :type _request_timeout: int, tuple(int, int), optional
1298
+ :param _request_auth: set to override the auth_settings for an a single
1299
+ request; this effectively ignores the
1300
+ authentication in the spec for a single request.
1301
+ :type _request_auth: dict, optional
1302
+ :param _content_type: force content-type for the request.
1303
+ :type _content_type: str, Optional
1304
+ :param _headers: set to override the headers for a single
1305
+ request; this effectively ignores the headers
1306
+ in the spec for a single request.
1307
+ :type _headers: dict, optional
1308
+ :param _host_index: set to override the host_index for a single
1309
+ request; this effectively ignores the host_index
1310
+ in the spec for a single request.
1311
+ :type _host_index: int, optional
1312
+ :return: Returns the result object.
1313
+ """ # noqa: E501
1314
+
1315
+ _param = self._find_in_files_serialize(
1316
+ path=path,
1317
+ pattern=pattern,
1318
+ _request_auth=_request_auth,
1319
+ _content_type=_content_type,
1320
+ _headers=_headers,
1321
+ _host_index=_host_index
1322
+ )
1323
+
1324
+ _response_types_map: Dict[str, Optional[str]] = {
1325
+ '200': "List[Match]",
1326
+ }
1327
+ response_data = self.api_client.call_api(
1328
+ *_param,
1329
+ _request_timeout=_request_timeout
1330
+ )
1331
+ return response_data.response
1332
+
1333
+
1334
+ def _find_in_files_serialize(
1335
+ self,
1336
+ path,
1337
+ pattern,
1338
+ _request_auth,
1339
+ _content_type,
1340
+ _headers,
1341
+ _host_index,
1342
+ ) -> RequestSerialized:
1343
+
1344
+ _host = None
1345
+
1346
+ _collection_formats: Dict[str, str] = {
1347
+ }
1348
+
1349
+ _path_params: Dict[str, str] = {}
1350
+ _query_params: List[Tuple[str, str]] = []
1351
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1352
+ _form_params: List[Tuple[str, str]] = []
1353
+ _files: Dict[
1354
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1355
+ ] = {}
1356
+ _body_params: Optional[bytes] = None
1357
+
1358
+ # process the path parameters
1359
+ # process the query parameters
1360
+ if path is not None:
1361
+
1362
+ _query_params.append(('path', path))
1363
+
1364
+ if pattern is not None:
1365
+
1366
+ _query_params.append(('pattern', pattern))
1367
+
1368
+ # process the header parameters
1369
+ # process the form parameters
1370
+ # process the body parameter
1371
+
1372
+
1373
+ # set the HTTP header `Accept`
1374
+ if 'Accept' not in _header_params:
1375
+ _header_params['Accept'] = self.api_client.select_header_accept(
1376
+ [
1377
+ 'application/json'
1378
+ ]
1379
+ )
1380
+
1381
+
1382
+ # authentication setting
1383
+ _auth_settings: List[str] = [
1384
+ ]
1385
+
1386
+ return self.api_client.param_serialize(
1387
+ method='GET',
1388
+ resource_path='/files/find',
1389
+ path_params=_path_params,
1390
+ query_params=_query_params,
1391
+ header_params=_header_params,
1392
+ body=_body_params,
1393
+ post_params=_form_params,
1394
+ files=_files,
1395
+ auth_settings=_auth_settings,
1396
+ collection_formats=_collection_formats,
1397
+ _host=_host,
1398
+ _request_auth=_request_auth
1399
+ )
1400
+
1401
+
1402
+
1403
+
1404
+ @validate_call
1405
+ def get_file_info(
1406
+ self,
1407
+ path: Annotated[StrictStr, Field(description="File or directory path")],
1408
+ _request_timeout: Union[
1409
+ None,
1410
+ Annotated[StrictFloat, Field(gt=0)],
1411
+ Tuple[
1412
+ Annotated[StrictFloat, Field(gt=0)],
1413
+ Annotated[StrictFloat, Field(gt=0)]
1414
+ ]
1415
+ ] = None,
1416
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1417
+ _content_type: Optional[StrictStr] = None,
1418
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1419
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1420
+ ) -> FileInfo:
1421
+ """Get file information
1422
+
1423
+ Get detailed information about a file or directory
1424
+
1425
+ :param path: File or directory path (required)
1426
+ :type path: str
1427
+ :param _request_timeout: timeout setting for this request. If one
1428
+ number provided, it will be total request
1429
+ timeout. It can also be a pair (tuple) of
1430
+ (connection, read) timeouts.
1431
+ :type _request_timeout: int, tuple(int, int), optional
1432
+ :param _request_auth: set to override the auth_settings for an a single
1433
+ request; this effectively ignores the
1434
+ authentication in the spec for a single request.
1435
+ :type _request_auth: dict, optional
1436
+ :param _content_type: force content-type for the request.
1437
+ :type _content_type: str, Optional
1438
+ :param _headers: set to override the headers for a single
1439
+ request; this effectively ignores the headers
1440
+ in the spec for a single request.
1441
+ :type _headers: dict, optional
1442
+ :param _host_index: set to override the host_index for a single
1443
+ request; this effectively ignores the host_index
1444
+ in the spec for a single request.
1445
+ :type _host_index: int, optional
1446
+ :return: Returns the result object.
1447
+ """ # noqa: E501
1448
+
1449
+ _param = self._get_file_info_serialize(
1450
+ path=path,
1451
+ _request_auth=_request_auth,
1452
+ _content_type=_content_type,
1453
+ _headers=_headers,
1454
+ _host_index=_host_index
1455
+ )
1456
+
1457
+ _response_types_map: Dict[str, Optional[str]] = {
1458
+ '200': "FileInfo",
1459
+ }
1460
+ response_data = self.api_client.call_api(
1461
+ *_param,
1462
+ _request_timeout=_request_timeout
1463
+ )
1464
+ response_data.read()
1465
+ return self.api_client.response_deserialize(
1466
+ response_data=response_data,
1467
+ response_types_map=_response_types_map,
1468
+ ).data
1469
+
1470
+
1471
+ @validate_call
1472
+ def get_file_info_with_http_info(
1473
+ self,
1474
+ path: Annotated[StrictStr, Field(description="File or directory path")],
1475
+ _request_timeout: Union[
1476
+ None,
1477
+ Annotated[StrictFloat, Field(gt=0)],
1478
+ Tuple[
1479
+ Annotated[StrictFloat, Field(gt=0)],
1480
+ Annotated[StrictFloat, Field(gt=0)]
1481
+ ]
1482
+ ] = None,
1483
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1484
+ _content_type: Optional[StrictStr] = None,
1485
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1486
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1487
+ ) -> ApiResponse[FileInfo]:
1488
+ """Get file information
1489
+
1490
+ Get detailed information about a file or directory
1491
+
1492
+ :param path: File or directory path (required)
1493
+ :type path: str
1494
+ :param _request_timeout: timeout setting for this request. If one
1495
+ number provided, it will be total request
1496
+ timeout. It can also be a pair (tuple) of
1497
+ (connection, read) timeouts.
1498
+ :type _request_timeout: int, tuple(int, int), optional
1499
+ :param _request_auth: set to override the auth_settings for an a single
1500
+ request; this effectively ignores the
1501
+ authentication in the spec for a single request.
1502
+ :type _request_auth: dict, optional
1503
+ :param _content_type: force content-type for the request.
1504
+ :type _content_type: str, Optional
1505
+ :param _headers: set to override the headers for a single
1506
+ request; this effectively ignores the headers
1507
+ in the spec for a single request.
1508
+ :type _headers: dict, optional
1509
+ :param _host_index: set to override the host_index for a single
1510
+ request; this effectively ignores the host_index
1511
+ in the spec for a single request.
1512
+ :type _host_index: int, optional
1513
+ :return: Returns the result object.
1514
+ """ # noqa: E501
1515
+
1516
+ _param = self._get_file_info_serialize(
1517
+ path=path,
1518
+ _request_auth=_request_auth,
1519
+ _content_type=_content_type,
1520
+ _headers=_headers,
1521
+ _host_index=_host_index
1522
+ )
1523
+
1524
+ _response_types_map: Dict[str, Optional[str]] = {
1525
+ '200': "FileInfo",
1526
+ }
1527
+ response_data = self.api_client.call_api(
1528
+ *_param,
1529
+ _request_timeout=_request_timeout
1530
+ )
1531
+ response_data.read()
1532
+ return self.api_client.response_deserialize(
1533
+ response_data=response_data,
1534
+ response_types_map=_response_types_map,
1535
+ )
1536
+
1537
+
1538
+ @validate_call
1539
+ def get_file_info_without_preload_content(
1540
+ self,
1541
+ path: Annotated[StrictStr, Field(description="File or directory path")],
1542
+ _request_timeout: Union[
1543
+ None,
1544
+ Annotated[StrictFloat, Field(gt=0)],
1545
+ Tuple[
1546
+ Annotated[StrictFloat, Field(gt=0)],
1547
+ Annotated[StrictFloat, Field(gt=0)]
1548
+ ]
1549
+ ] = None,
1550
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1551
+ _content_type: Optional[StrictStr] = None,
1552
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1553
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1554
+ ) -> RESTResponseType:
1555
+ """Get file information
1556
+
1557
+ Get detailed information about a file or directory
1558
+
1559
+ :param path: File or directory path (required)
1560
+ :type path: str
1561
+ :param _request_timeout: timeout setting for this request. If one
1562
+ number provided, it will be total request
1563
+ timeout. It can also be a pair (tuple) of
1564
+ (connection, read) timeouts.
1565
+ :type _request_timeout: int, tuple(int, int), optional
1566
+ :param _request_auth: set to override the auth_settings for an a single
1567
+ request; this effectively ignores the
1568
+ authentication in the spec for a single request.
1569
+ :type _request_auth: dict, optional
1570
+ :param _content_type: force content-type for the request.
1571
+ :type _content_type: str, Optional
1572
+ :param _headers: set to override the headers for a single
1573
+ request; this effectively ignores the headers
1574
+ in the spec for a single request.
1575
+ :type _headers: dict, optional
1576
+ :param _host_index: set to override the host_index for a single
1577
+ request; this effectively ignores the host_index
1578
+ in the spec for a single request.
1579
+ :type _host_index: int, optional
1580
+ :return: Returns the result object.
1581
+ """ # noqa: E501
1582
+
1583
+ _param = self._get_file_info_serialize(
1584
+ path=path,
1585
+ _request_auth=_request_auth,
1586
+ _content_type=_content_type,
1587
+ _headers=_headers,
1588
+ _host_index=_host_index
1589
+ )
1590
+
1591
+ _response_types_map: Dict[str, Optional[str]] = {
1592
+ '200': "FileInfo",
1593
+ }
1594
+ response_data = self.api_client.call_api(
1595
+ *_param,
1596
+ _request_timeout=_request_timeout
1597
+ )
1598
+ return response_data.response
1599
+
1600
+
1601
+ def _get_file_info_serialize(
1602
+ self,
1603
+ path,
1604
+ _request_auth,
1605
+ _content_type,
1606
+ _headers,
1607
+ _host_index,
1608
+ ) -> RequestSerialized:
1609
+
1610
+ _host = None
1611
+
1612
+ _collection_formats: Dict[str, str] = {
1613
+ }
1614
+
1615
+ _path_params: Dict[str, str] = {}
1616
+ _query_params: List[Tuple[str, str]] = []
1617
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1618
+ _form_params: List[Tuple[str, str]] = []
1619
+ _files: Dict[
1620
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1621
+ ] = {}
1622
+ _body_params: Optional[bytes] = None
1623
+
1624
+ # process the path parameters
1625
+ # process the query parameters
1626
+ if path is not None:
1627
+
1628
+ _query_params.append(('path', path))
1629
+
1630
+ # process the header parameters
1631
+ # process the form parameters
1632
+ # process the body parameter
1633
+
1634
+
1635
+ # set the HTTP header `Accept`
1636
+ if 'Accept' not in _header_params:
1637
+ _header_params['Accept'] = self.api_client.select_header_accept(
1638
+ [
1639
+ 'application/json'
1640
+ ]
1641
+ )
1642
+
1643
+
1644
+ # authentication setting
1645
+ _auth_settings: List[str] = [
1646
+ ]
1647
+
1648
+ return self.api_client.param_serialize(
1649
+ method='GET',
1650
+ resource_path='/files/info',
1651
+ path_params=_path_params,
1652
+ query_params=_query_params,
1653
+ header_params=_header_params,
1654
+ body=_body_params,
1655
+ post_params=_form_params,
1656
+ files=_files,
1657
+ auth_settings=_auth_settings,
1658
+ collection_formats=_collection_formats,
1659
+ _host=_host,
1660
+ _request_auth=_request_auth
1661
+ )
1662
+
1663
+
1664
+
1665
+
1666
+ @validate_call
1667
+ def list_files(
1668
+ self,
1669
+ path: Annotated[Optional[StrictStr], Field(description="Directory path to list (defaults to working directory)")] = None,
1670
+ _request_timeout: Union[
1671
+ None,
1672
+ Annotated[StrictFloat, Field(gt=0)],
1673
+ Tuple[
1674
+ Annotated[StrictFloat, Field(gt=0)],
1675
+ Annotated[StrictFloat, Field(gt=0)]
1676
+ ]
1677
+ ] = None,
1678
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1679
+ _content_type: Optional[StrictStr] = None,
1680
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1681
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1682
+ ) -> List[FileInfo]:
1683
+ """List files and directories
1684
+
1685
+ List files and directories in the specified path
1686
+
1687
+ :param path: Directory path to list (defaults to working directory)
1688
+ :type path: str
1689
+ :param _request_timeout: timeout setting for this request. If one
1690
+ number provided, it will be total request
1691
+ timeout. It can also be a pair (tuple) of
1692
+ (connection, read) timeouts.
1693
+ :type _request_timeout: int, tuple(int, int), optional
1694
+ :param _request_auth: set to override the auth_settings for an a single
1695
+ request; this effectively ignores the
1696
+ authentication in the spec for a single request.
1697
+ :type _request_auth: dict, optional
1698
+ :param _content_type: force content-type for the request.
1699
+ :type _content_type: str, Optional
1700
+ :param _headers: set to override the headers for a single
1701
+ request; this effectively ignores the headers
1702
+ in the spec for a single request.
1703
+ :type _headers: dict, optional
1704
+ :param _host_index: set to override the host_index for a single
1705
+ request; this effectively ignores the host_index
1706
+ in the spec for a single request.
1707
+ :type _host_index: int, optional
1708
+ :return: Returns the result object.
1709
+ """ # noqa: E501
1710
+
1711
+ _param = self._list_files_serialize(
1712
+ path=path,
1713
+ _request_auth=_request_auth,
1714
+ _content_type=_content_type,
1715
+ _headers=_headers,
1716
+ _host_index=_host_index
1717
+ )
1718
+
1719
+ _response_types_map: Dict[str, Optional[str]] = {
1720
+ '200': "List[FileInfo]",
1721
+ }
1722
+ response_data = self.api_client.call_api(
1723
+ *_param,
1724
+ _request_timeout=_request_timeout
1725
+ )
1726
+ response_data.read()
1727
+ return self.api_client.response_deserialize(
1728
+ response_data=response_data,
1729
+ response_types_map=_response_types_map,
1730
+ ).data
1731
+
1732
+
1733
+ @validate_call
1734
+ def list_files_with_http_info(
1735
+ self,
1736
+ path: Annotated[Optional[StrictStr], Field(description="Directory path to list (defaults to working directory)")] = None,
1737
+ _request_timeout: Union[
1738
+ None,
1739
+ Annotated[StrictFloat, Field(gt=0)],
1740
+ Tuple[
1741
+ Annotated[StrictFloat, Field(gt=0)],
1742
+ Annotated[StrictFloat, Field(gt=0)]
1743
+ ]
1744
+ ] = None,
1745
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1746
+ _content_type: Optional[StrictStr] = None,
1747
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1748
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1749
+ ) -> ApiResponse[List[FileInfo]]:
1750
+ """List files and directories
1751
+
1752
+ List files and directories in the specified path
1753
+
1754
+ :param path: Directory path to list (defaults to working directory)
1755
+ :type path: str
1756
+ :param _request_timeout: timeout setting for this request. If one
1757
+ number provided, it will be total request
1758
+ timeout. It can also be a pair (tuple) of
1759
+ (connection, read) timeouts.
1760
+ :type _request_timeout: int, tuple(int, int), optional
1761
+ :param _request_auth: set to override the auth_settings for an a single
1762
+ request; this effectively ignores the
1763
+ authentication in the spec for a single request.
1764
+ :type _request_auth: dict, optional
1765
+ :param _content_type: force content-type for the request.
1766
+ :type _content_type: str, Optional
1767
+ :param _headers: set to override the headers for a single
1768
+ request; this effectively ignores the headers
1769
+ in the spec for a single request.
1770
+ :type _headers: dict, optional
1771
+ :param _host_index: set to override the host_index for a single
1772
+ request; this effectively ignores the host_index
1773
+ in the spec for a single request.
1774
+ :type _host_index: int, optional
1775
+ :return: Returns the result object.
1776
+ """ # noqa: E501
1777
+
1778
+ _param = self._list_files_serialize(
1779
+ path=path,
1780
+ _request_auth=_request_auth,
1781
+ _content_type=_content_type,
1782
+ _headers=_headers,
1783
+ _host_index=_host_index
1784
+ )
1785
+
1786
+ _response_types_map: Dict[str, Optional[str]] = {
1787
+ '200': "List[FileInfo]",
1788
+ }
1789
+ response_data = self.api_client.call_api(
1790
+ *_param,
1791
+ _request_timeout=_request_timeout
1792
+ )
1793
+ response_data.read()
1794
+ return self.api_client.response_deserialize(
1795
+ response_data=response_data,
1796
+ response_types_map=_response_types_map,
1797
+ )
1798
+
1799
+
1800
+ @validate_call
1801
+ def list_files_without_preload_content(
1802
+ self,
1803
+ path: Annotated[Optional[StrictStr], Field(description="Directory path to list (defaults to working directory)")] = None,
1804
+ _request_timeout: Union[
1805
+ None,
1806
+ Annotated[StrictFloat, Field(gt=0)],
1807
+ Tuple[
1808
+ Annotated[StrictFloat, Field(gt=0)],
1809
+ Annotated[StrictFloat, Field(gt=0)]
1810
+ ]
1811
+ ] = None,
1812
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1813
+ _content_type: Optional[StrictStr] = None,
1814
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1815
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1816
+ ) -> RESTResponseType:
1817
+ """List files and directories
1818
+
1819
+ List files and directories in the specified path
1820
+
1821
+ :param path: Directory path to list (defaults to working directory)
1822
+ :type path: str
1823
+ :param _request_timeout: timeout setting for this request. If one
1824
+ number provided, it will be total request
1825
+ timeout. It can also be a pair (tuple) of
1826
+ (connection, read) timeouts.
1827
+ :type _request_timeout: int, tuple(int, int), optional
1828
+ :param _request_auth: set to override the auth_settings for an a single
1829
+ request; this effectively ignores the
1830
+ authentication in the spec for a single request.
1831
+ :type _request_auth: dict, optional
1832
+ :param _content_type: force content-type for the request.
1833
+ :type _content_type: str, Optional
1834
+ :param _headers: set to override the headers for a single
1835
+ request; this effectively ignores the headers
1836
+ in the spec for a single request.
1837
+ :type _headers: dict, optional
1838
+ :param _host_index: set to override the host_index for a single
1839
+ request; this effectively ignores the host_index
1840
+ in the spec for a single request.
1841
+ :type _host_index: int, optional
1842
+ :return: Returns the result object.
1843
+ """ # noqa: E501
1844
+
1845
+ _param = self._list_files_serialize(
1846
+ path=path,
1847
+ _request_auth=_request_auth,
1848
+ _content_type=_content_type,
1849
+ _headers=_headers,
1850
+ _host_index=_host_index
1851
+ )
1852
+
1853
+ _response_types_map: Dict[str, Optional[str]] = {
1854
+ '200': "List[FileInfo]",
1855
+ }
1856
+ response_data = self.api_client.call_api(
1857
+ *_param,
1858
+ _request_timeout=_request_timeout
1859
+ )
1860
+ return response_data.response
1861
+
1862
+
1863
+ def _list_files_serialize(
1864
+ self,
1865
+ path,
1866
+ _request_auth,
1867
+ _content_type,
1868
+ _headers,
1869
+ _host_index,
1870
+ ) -> RequestSerialized:
1871
+
1872
+ _host = None
1873
+
1874
+ _collection_formats: Dict[str, str] = {
1875
+ }
1876
+
1877
+ _path_params: Dict[str, str] = {}
1878
+ _query_params: List[Tuple[str, str]] = []
1879
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1880
+ _form_params: List[Tuple[str, str]] = []
1881
+ _files: Dict[
1882
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1883
+ ] = {}
1884
+ _body_params: Optional[bytes] = None
1885
+
1886
+ # process the path parameters
1887
+ # process the query parameters
1888
+ if path is not None:
1889
+
1890
+ _query_params.append(('path', path))
1891
+
1892
+ # process the header parameters
1893
+ # process the form parameters
1894
+ # process the body parameter
1895
+
1896
+
1897
+ # set the HTTP header `Accept`
1898
+ if 'Accept' not in _header_params:
1899
+ _header_params['Accept'] = self.api_client.select_header_accept(
1900
+ [
1901
+ 'application/json'
1902
+ ]
1903
+ )
1904
+
1905
+
1906
+ # authentication setting
1907
+ _auth_settings: List[str] = [
1908
+ ]
1909
+
1910
+ return self.api_client.param_serialize(
1911
+ method='GET',
1912
+ resource_path='/files',
1913
+ path_params=_path_params,
1914
+ query_params=_query_params,
1915
+ header_params=_header_params,
1916
+ body=_body_params,
1917
+ post_params=_form_params,
1918
+ files=_files,
1919
+ auth_settings=_auth_settings,
1920
+ collection_formats=_collection_formats,
1921
+ _host=_host,
1922
+ _request_auth=_request_auth
1923
+ )
1924
+
1925
+
1926
+
1927
+
1928
+ @validate_call
1929
+ def move_file(
1930
+ self,
1931
+ source: Annotated[StrictStr, Field(description="Source file or directory path")],
1932
+ destination: Annotated[StrictStr, Field(description="Destination file or directory path")],
1933
+ _request_timeout: Union[
1934
+ None,
1935
+ Annotated[StrictFloat, Field(gt=0)],
1936
+ Tuple[
1937
+ Annotated[StrictFloat, Field(gt=0)],
1938
+ Annotated[StrictFloat, Field(gt=0)]
1939
+ ]
1940
+ ] = None,
1941
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1942
+ _content_type: Optional[StrictStr] = None,
1943
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1944
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1945
+ ) -> None:
1946
+ """Move or rename file/directory
1947
+
1948
+ Move or rename a file or directory from source to destination
1949
+
1950
+ :param source: Source file or directory path (required)
1951
+ :type source: str
1952
+ :param destination: Destination file or directory path (required)
1953
+ :type destination: str
1954
+ :param _request_timeout: timeout setting for this request. If one
1955
+ number provided, it will be total request
1956
+ timeout. It can also be a pair (tuple) of
1957
+ (connection, read) timeouts.
1958
+ :type _request_timeout: int, tuple(int, int), optional
1959
+ :param _request_auth: set to override the auth_settings for an a single
1960
+ request; this effectively ignores the
1961
+ authentication in the spec for a single request.
1962
+ :type _request_auth: dict, optional
1963
+ :param _content_type: force content-type for the request.
1964
+ :type _content_type: str, Optional
1965
+ :param _headers: set to override the headers for a single
1966
+ request; this effectively ignores the headers
1967
+ in the spec for a single request.
1968
+ :type _headers: dict, optional
1969
+ :param _host_index: set to override the host_index for a single
1970
+ request; this effectively ignores the host_index
1971
+ in the spec for a single request.
1972
+ :type _host_index: int, optional
1973
+ :return: Returns the result object.
1974
+ """ # noqa: E501
1975
+
1976
+ _param = self._move_file_serialize(
1977
+ source=source,
1978
+ destination=destination,
1979
+ _request_auth=_request_auth,
1980
+ _content_type=_content_type,
1981
+ _headers=_headers,
1982
+ _host_index=_host_index
1983
+ )
1984
+
1985
+ _response_types_map: Dict[str, Optional[str]] = {
1986
+ '200': None,
1987
+ }
1988
+ response_data = self.api_client.call_api(
1989
+ *_param,
1990
+ _request_timeout=_request_timeout
1991
+ )
1992
+ response_data.read()
1993
+ return self.api_client.response_deserialize(
1994
+ response_data=response_data,
1995
+ response_types_map=_response_types_map,
1996
+ ).data
1997
+
1998
+
1999
+ @validate_call
2000
+ def move_file_with_http_info(
2001
+ self,
2002
+ source: Annotated[StrictStr, Field(description="Source file or directory path")],
2003
+ destination: Annotated[StrictStr, Field(description="Destination file or directory path")],
2004
+ _request_timeout: Union[
2005
+ None,
2006
+ Annotated[StrictFloat, Field(gt=0)],
2007
+ Tuple[
2008
+ Annotated[StrictFloat, Field(gt=0)],
2009
+ Annotated[StrictFloat, Field(gt=0)]
2010
+ ]
2011
+ ] = None,
2012
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2013
+ _content_type: Optional[StrictStr] = None,
2014
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2015
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2016
+ ) -> ApiResponse[None]:
2017
+ """Move or rename file/directory
2018
+
2019
+ Move or rename a file or directory from source to destination
2020
+
2021
+ :param source: Source file or directory path (required)
2022
+ :type source: str
2023
+ :param destination: Destination file or directory path (required)
2024
+ :type destination: str
2025
+ :param _request_timeout: timeout setting for this request. If one
2026
+ number provided, it will be total request
2027
+ timeout. It can also be a pair (tuple) of
2028
+ (connection, read) timeouts.
2029
+ :type _request_timeout: int, tuple(int, int), optional
2030
+ :param _request_auth: set to override the auth_settings for an a single
2031
+ request; this effectively ignores the
2032
+ authentication in the spec for a single request.
2033
+ :type _request_auth: dict, optional
2034
+ :param _content_type: force content-type for the request.
2035
+ :type _content_type: str, Optional
2036
+ :param _headers: set to override the headers for a single
2037
+ request; this effectively ignores the headers
2038
+ in the spec for a single request.
2039
+ :type _headers: dict, optional
2040
+ :param _host_index: set to override the host_index for a single
2041
+ request; this effectively ignores the host_index
2042
+ in the spec for a single request.
2043
+ :type _host_index: int, optional
2044
+ :return: Returns the result object.
2045
+ """ # noqa: E501
2046
+
2047
+ _param = self._move_file_serialize(
2048
+ source=source,
2049
+ destination=destination,
2050
+ _request_auth=_request_auth,
2051
+ _content_type=_content_type,
2052
+ _headers=_headers,
2053
+ _host_index=_host_index
2054
+ )
2055
+
2056
+ _response_types_map: Dict[str, Optional[str]] = {
2057
+ '200': None,
2058
+ }
2059
+ response_data = self.api_client.call_api(
2060
+ *_param,
2061
+ _request_timeout=_request_timeout
2062
+ )
2063
+ response_data.read()
2064
+ return self.api_client.response_deserialize(
2065
+ response_data=response_data,
2066
+ response_types_map=_response_types_map,
2067
+ )
2068
+
2069
+
2070
+ @validate_call
2071
+ def move_file_without_preload_content(
2072
+ self,
2073
+ source: Annotated[StrictStr, Field(description="Source file or directory path")],
2074
+ destination: Annotated[StrictStr, Field(description="Destination file or directory path")],
2075
+ _request_timeout: Union[
2076
+ None,
2077
+ Annotated[StrictFloat, Field(gt=0)],
2078
+ Tuple[
2079
+ Annotated[StrictFloat, Field(gt=0)],
2080
+ Annotated[StrictFloat, Field(gt=0)]
2081
+ ]
2082
+ ] = None,
2083
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2084
+ _content_type: Optional[StrictStr] = None,
2085
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2086
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2087
+ ) -> RESTResponseType:
2088
+ """Move or rename file/directory
2089
+
2090
+ Move or rename a file or directory from source to destination
2091
+
2092
+ :param source: Source file or directory path (required)
2093
+ :type source: str
2094
+ :param destination: Destination file or directory path (required)
2095
+ :type destination: str
2096
+ :param _request_timeout: timeout setting for this request. If one
2097
+ number provided, it will be total request
2098
+ timeout. It can also be a pair (tuple) of
2099
+ (connection, read) timeouts.
2100
+ :type _request_timeout: int, tuple(int, int), optional
2101
+ :param _request_auth: set to override the auth_settings for an a single
2102
+ request; this effectively ignores the
2103
+ authentication in the spec for a single request.
2104
+ :type _request_auth: dict, optional
2105
+ :param _content_type: force content-type for the request.
2106
+ :type _content_type: str, Optional
2107
+ :param _headers: set to override the headers for a single
2108
+ request; this effectively ignores the headers
2109
+ in the spec for a single request.
2110
+ :type _headers: dict, optional
2111
+ :param _host_index: set to override the host_index for a single
2112
+ request; this effectively ignores the host_index
2113
+ in the spec for a single request.
2114
+ :type _host_index: int, optional
2115
+ :return: Returns the result object.
2116
+ """ # noqa: E501
2117
+
2118
+ _param = self._move_file_serialize(
2119
+ source=source,
2120
+ destination=destination,
2121
+ _request_auth=_request_auth,
2122
+ _content_type=_content_type,
2123
+ _headers=_headers,
2124
+ _host_index=_host_index
2125
+ )
2126
+
2127
+ _response_types_map: Dict[str, Optional[str]] = {
2128
+ '200': None,
2129
+ }
2130
+ response_data = self.api_client.call_api(
2131
+ *_param,
2132
+ _request_timeout=_request_timeout
2133
+ )
2134
+ return response_data.response
2135
+
2136
+
2137
+ def _move_file_serialize(
2138
+ self,
2139
+ source,
2140
+ destination,
2141
+ _request_auth,
2142
+ _content_type,
2143
+ _headers,
2144
+ _host_index,
2145
+ ) -> RequestSerialized:
2146
+
2147
+ _host = None
2148
+
2149
+ _collection_formats: Dict[str, str] = {
2150
+ }
2151
+
2152
+ _path_params: Dict[str, str] = {}
2153
+ _query_params: List[Tuple[str, str]] = []
2154
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2155
+ _form_params: List[Tuple[str, str]] = []
2156
+ _files: Dict[
2157
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2158
+ ] = {}
2159
+ _body_params: Optional[bytes] = None
2160
+
2161
+ # process the path parameters
2162
+ # process the query parameters
2163
+ if source is not None:
2164
+
2165
+ _query_params.append(('source', source))
2166
+
2167
+ if destination is not None:
2168
+
2169
+ _query_params.append(('destination', destination))
2170
+
2171
+ # process the header parameters
2172
+ # process the form parameters
2173
+ # process the body parameter
2174
+
2175
+
2176
+
2177
+
2178
+ # authentication setting
2179
+ _auth_settings: List[str] = [
2180
+ ]
2181
+
2182
+ return self.api_client.param_serialize(
2183
+ method='POST',
2184
+ resource_path='/files/move',
2185
+ path_params=_path_params,
2186
+ query_params=_query_params,
2187
+ header_params=_header_params,
2188
+ body=_body_params,
2189
+ post_params=_form_params,
2190
+ files=_files,
2191
+ auth_settings=_auth_settings,
2192
+ collection_formats=_collection_formats,
2193
+ _host=_host,
2194
+ _request_auth=_request_auth
2195
+ )
2196
+
2197
+
2198
+
2199
+
2200
+ @validate_call
2201
+ def replace_in_files(
2202
+ self,
2203
+ request: Annotated[ReplaceRequest, Field(description="Replace request")],
2204
+ _request_timeout: Union[
2205
+ None,
2206
+ Annotated[StrictFloat, Field(gt=0)],
2207
+ Tuple[
2208
+ Annotated[StrictFloat, Field(gt=0)],
2209
+ Annotated[StrictFloat, Field(gt=0)]
2210
+ ]
2211
+ ] = None,
2212
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2213
+ _content_type: Optional[StrictStr] = None,
2214
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2215
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2216
+ ) -> List[ReplaceResult]:
2217
+ """Replace text in files
2218
+
2219
+ Replace text pattern with new value in multiple files
2220
+
2221
+ :param request: Replace request (required)
2222
+ :type request: ReplaceRequest
2223
+ :param _request_timeout: timeout setting for this request. If one
2224
+ number provided, it will be total request
2225
+ timeout. It can also be a pair (tuple) of
2226
+ (connection, read) timeouts.
2227
+ :type _request_timeout: int, tuple(int, int), optional
2228
+ :param _request_auth: set to override the auth_settings for an a single
2229
+ request; this effectively ignores the
2230
+ authentication in the spec for a single request.
2231
+ :type _request_auth: dict, optional
2232
+ :param _content_type: force content-type for the request.
2233
+ :type _content_type: str, Optional
2234
+ :param _headers: set to override the headers for a single
2235
+ request; this effectively ignores the headers
2236
+ in the spec for a single request.
2237
+ :type _headers: dict, optional
2238
+ :param _host_index: set to override the host_index for a single
2239
+ request; this effectively ignores the host_index
2240
+ in the spec for a single request.
2241
+ :type _host_index: int, optional
2242
+ :return: Returns the result object.
2243
+ """ # noqa: E501
2244
+
2245
+ _param = self._replace_in_files_serialize(
2246
+ request=request,
2247
+ _request_auth=_request_auth,
2248
+ _content_type=_content_type,
2249
+ _headers=_headers,
2250
+ _host_index=_host_index
2251
+ )
2252
+
2253
+ _response_types_map: Dict[str, Optional[str]] = {
2254
+ '200': "List[ReplaceResult]",
2255
+ }
2256
+ response_data = self.api_client.call_api(
2257
+ *_param,
2258
+ _request_timeout=_request_timeout
2259
+ )
2260
+ response_data.read()
2261
+ return self.api_client.response_deserialize(
2262
+ response_data=response_data,
2263
+ response_types_map=_response_types_map,
2264
+ ).data
2265
+
2266
+
2267
+ @validate_call
2268
+ def replace_in_files_with_http_info(
2269
+ self,
2270
+ request: Annotated[ReplaceRequest, Field(description="Replace request")],
2271
+ _request_timeout: Union[
2272
+ None,
2273
+ Annotated[StrictFloat, Field(gt=0)],
2274
+ Tuple[
2275
+ Annotated[StrictFloat, Field(gt=0)],
2276
+ Annotated[StrictFloat, Field(gt=0)]
2277
+ ]
2278
+ ] = None,
2279
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2280
+ _content_type: Optional[StrictStr] = None,
2281
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2282
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2283
+ ) -> ApiResponse[List[ReplaceResult]]:
2284
+ """Replace text in files
2285
+
2286
+ Replace text pattern with new value in multiple files
2287
+
2288
+ :param request: Replace request (required)
2289
+ :type request: ReplaceRequest
2290
+ :param _request_timeout: timeout setting for this request. If one
2291
+ number provided, it will be total request
2292
+ timeout. It can also be a pair (tuple) of
2293
+ (connection, read) timeouts.
2294
+ :type _request_timeout: int, tuple(int, int), optional
2295
+ :param _request_auth: set to override the auth_settings for an a single
2296
+ request; this effectively ignores the
2297
+ authentication in the spec for a single request.
2298
+ :type _request_auth: dict, optional
2299
+ :param _content_type: force content-type for the request.
2300
+ :type _content_type: str, Optional
2301
+ :param _headers: set to override the headers for a single
2302
+ request; this effectively ignores the headers
2303
+ in the spec for a single request.
2304
+ :type _headers: dict, optional
2305
+ :param _host_index: set to override the host_index for a single
2306
+ request; this effectively ignores the host_index
2307
+ in the spec for a single request.
2308
+ :type _host_index: int, optional
2309
+ :return: Returns the result object.
2310
+ """ # noqa: E501
2311
+
2312
+ _param = self._replace_in_files_serialize(
2313
+ request=request,
2314
+ _request_auth=_request_auth,
2315
+ _content_type=_content_type,
2316
+ _headers=_headers,
2317
+ _host_index=_host_index
2318
+ )
2319
+
2320
+ _response_types_map: Dict[str, Optional[str]] = {
2321
+ '200': "List[ReplaceResult]",
2322
+ }
2323
+ response_data = self.api_client.call_api(
2324
+ *_param,
2325
+ _request_timeout=_request_timeout
2326
+ )
2327
+ response_data.read()
2328
+ return self.api_client.response_deserialize(
2329
+ response_data=response_data,
2330
+ response_types_map=_response_types_map,
2331
+ )
2332
+
2333
+
2334
+ @validate_call
2335
+ def replace_in_files_without_preload_content(
2336
+ self,
2337
+ request: Annotated[ReplaceRequest, Field(description="Replace request")],
2338
+ _request_timeout: Union[
2339
+ None,
2340
+ Annotated[StrictFloat, Field(gt=0)],
2341
+ Tuple[
2342
+ Annotated[StrictFloat, Field(gt=0)],
2343
+ Annotated[StrictFloat, Field(gt=0)]
2344
+ ]
2345
+ ] = None,
2346
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2347
+ _content_type: Optional[StrictStr] = None,
2348
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2349
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2350
+ ) -> RESTResponseType:
2351
+ """Replace text in files
2352
+
2353
+ Replace text pattern with new value in multiple files
2354
+
2355
+ :param request: Replace request (required)
2356
+ :type request: ReplaceRequest
2357
+ :param _request_timeout: timeout setting for this request. If one
2358
+ number provided, it will be total request
2359
+ timeout. It can also be a pair (tuple) of
2360
+ (connection, read) timeouts.
2361
+ :type _request_timeout: int, tuple(int, int), optional
2362
+ :param _request_auth: set to override the auth_settings for an a single
2363
+ request; this effectively ignores the
2364
+ authentication in the spec for a single request.
2365
+ :type _request_auth: dict, optional
2366
+ :param _content_type: force content-type for the request.
2367
+ :type _content_type: str, Optional
2368
+ :param _headers: set to override the headers for a single
2369
+ request; this effectively ignores the headers
2370
+ in the spec for a single request.
2371
+ :type _headers: dict, optional
2372
+ :param _host_index: set to override the host_index for a single
2373
+ request; this effectively ignores the host_index
2374
+ in the spec for a single request.
2375
+ :type _host_index: int, optional
2376
+ :return: Returns the result object.
2377
+ """ # noqa: E501
2378
+
2379
+ _param = self._replace_in_files_serialize(
2380
+ request=request,
2381
+ _request_auth=_request_auth,
2382
+ _content_type=_content_type,
2383
+ _headers=_headers,
2384
+ _host_index=_host_index
2385
+ )
2386
+
2387
+ _response_types_map: Dict[str, Optional[str]] = {
2388
+ '200': "List[ReplaceResult]",
2389
+ }
2390
+ response_data = self.api_client.call_api(
2391
+ *_param,
2392
+ _request_timeout=_request_timeout
2393
+ )
2394
+ return response_data.response
2395
+
2396
+
2397
+ def _replace_in_files_serialize(
2398
+ self,
2399
+ request,
2400
+ _request_auth,
2401
+ _content_type,
2402
+ _headers,
2403
+ _host_index,
2404
+ ) -> RequestSerialized:
2405
+
2406
+ _host = None
2407
+
2408
+ _collection_formats: Dict[str, str] = {
2409
+ }
2410
+
2411
+ _path_params: Dict[str, str] = {}
2412
+ _query_params: List[Tuple[str, str]] = []
2413
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2414
+ _form_params: List[Tuple[str, str]] = []
2415
+ _files: Dict[
2416
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2417
+ ] = {}
2418
+ _body_params: Optional[bytes] = None
2419
+
2420
+ # process the path parameters
2421
+ # process the query parameters
2422
+ # process the header parameters
2423
+ # process the form parameters
2424
+ # process the body parameter
2425
+ if request is not None:
2426
+ _body_params = request
2427
+
2428
+
2429
+ # set the HTTP header `Accept`
2430
+ if 'Accept' not in _header_params:
2431
+ _header_params['Accept'] = self.api_client.select_header_accept(
2432
+ [
2433
+ 'application/json'
2434
+ ]
2435
+ )
2436
+
2437
+ # set the HTTP header `Content-Type`
2438
+ if _content_type:
2439
+ _header_params['Content-Type'] = _content_type
2440
+ else:
2441
+ _default_content_type = (
2442
+ self.api_client.select_header_content_type(
2443
+ [
2444
+ 'application/json'
2445
+ ]
2446
+ )
2447
+ )
2448
+ if _default_content_type is not None:
2449
+ _header_params['Content-Type'] = _default_content_type
2450
+
2451
+ # authentication setting
2452
+ _auth_settings: List[str] = [
2453
+ ]
2454
+
2455
+ return self.api_client.param_serialize(
2456
+ method='POST',
2457
+ resource_path='/files/replace',
2458
+ path_params=_path_params,
2459
+ query_params=_query_params,
2460
+ header_params=_header_params,
2461
+ body=_body_params,
2462
+ post_params=_form_params,
2463
+ files=_files,
2464
+ auth_settings=_auth_settings,
2465
+ collection_formats=_collection_formats,
2466
+ _host=_host,
2467
+ _request_auth=_request_auth
2468
+ )
2469
+
2470
+
2471
+
2472
+
2473
+ @validate_call
2474
+ def search_files(
2475
+ self,
2476
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
2477
+ pattern: Annotated[StrictStr, Field(description="File pattern to match (e.g., *.txt, *.go)")],
2478
+ _request_timeout: Union[
2479
+ None,
2480
+ Annotated[StrictFloat, Field(gt=0)],
2481
+ Tuple[
2482
+ Annotated[StrictFloat, Field(gt=0)],
2483
+ Annotated[StrictFloat, Field(gt=0)]
2484
+ ]
2485
+ ] = None,
2486
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2487
+ _content_type: Optional[StrictStr] = None,
2488
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2489
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2490
+ ) -> SearchFilesResponse:
2491
+ """Search files by pattern
2492
+
2493
+ Search for files matching a specific pattern in a directory
2494
+
2495
+ :param path: Directory path to search in (required)
2496
+ :type path: str
2497
+ :param pattern: File pattern to match (e.g., *.txt, *.go) (required)
2498
+ :type pattern: str
2499
+ :param _request_timeout: timeout setting for this request. If one
2500
+ number provided, it will be total request
2501
+ timeout. It can also be a pair (tuple) of
2502
+ (connection, read) timeouts.
2503
+ :type _request_timeout: int, tuple(int, int), optional
2504
+ :param _request_auth: set to override the auth_settings for an a single
2505
+ request; this effectively ignores the
2506
+ authentication in the spec for a single request.
2507
+ :type _request_auth: dict, optional
2508
+ :param _content_type: force content-type for the request.
2509
+ :type _content_type: str, Optional
2510
+ :param _headers: set to override the headers for a single
2511
+ request; this effectively ignores the headers
2512
+ in the spec for a single request.
2513
+ :type _headers: dict, optional
2514
+ :param _host_index: set to override the host_index for a single
2515
+ request; this effectively ignores the host_index
2516
+ in the spec for a single request.
2517
+ :type _host_index: int, optional
2518
+ :return: Returns the result object.
2519
+ """ # noqa: E501
2520
+
2521
+ _param = self._search_files_serialize(
2522
+ path=path,
2523
+ pattern=pattern,
2524
+ _request_auth=_request_auth,
2525
+ _content_type=_content_type,
2526
+ _headers=_headers,
2527
+ _host_index=_host_index
2528
+ )
2529
+
2530
+ _response_types_map: Dict[str, Optional[str]] = {
2531
+ '200': "SearchFilesResponse",
2532
+ }
2533
+ response_data = self.api_client.call_api(
2534
+ *_param,
2535
+ _request_timeout=_request_timeout
2536
+ )
2537
+ response_data.read()
2538
+ return self.api_client.response_deserialize(
2539
+ response_data=response_data,
2540
+ response_types_map=_response_types_map,
2541
+ ).data
2542
+
2543
+
2544
+ @validate_call
2545
+ def search_files_with_http_info(
2546
+ self,
2547
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
2548
+ pattern: Annotated[StrictStr, Field(description="File pattern to match (e.g., *.txt, *.go)")],
2549
+ _request_timeout: Union[
2550
+ None,
2551
+ Annotated[StrictFloat, Field(gt=0)],
2552
+ Tuple[
2553
+ Annotated[StrictFloat, Field(gt=0)],
2554
+ Annotated[StrictFloat, Field(gt=0)]
2555
+ ]
2556
+ ] = None,
2557
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2558
+ _content_type: Optional[StrictStr] = None,
2559
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2560
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2561
+ ) -> ApiResponse[SearchFilesResponse]:
2562
+ """Search files by pattern
2563
+
2564
+ Search for files matching a specific pattern in a directory
2565
+
2566
+ :param path: Directory path to search in (required)
2567
+ :type path: str
2568
+ :param pattern: File pattern to match (e.g., *.txt, *.go) (required)
2569
+ :type pattern: str
2570
+ :param _request_timeout: timeout setting for this request. If one
2571
+ number provided, it will be total request
2572
+ timeout. It can also be a pair (tuple) of
2573
+ (connection, read) timeouts.
2574
+ :type _request_timeout: int, tuple(int, int), optional
2575
+ :param _request_auth: set to override the auth_settings for an a single
2576
+ request; this effectively ignores the
2577
+ authentication in the spec for a single request.
2578
+ :type _request_auth: dict, optional
2579
+ :param _content_type: force content-type for the request.
2580
+ :type _content_type: str, Optional
2581
+ :param _headers: set to override the headers for a single
2582
+ request; this effectively ignores the headers
2583
+ in the spec for a single request.
2584
+ :type _headers: dict, optional
2585
+ :param _host_index: set to override the host_index for a single
2586
+ request; this effectively ignores the host_index
2587
+ in the spec for a single request.
2588
+ :type _host_index: int, optional
2589
+ :return: Returns the result object.
2590
+ """ # noqa: E501
2591
+
2592
+ _param = self._search_files_serialize(
2593
+ path=path,
2594
+ pattern=pattern,
2595
+ _request_auth=_request_auth,
2596
+ _content_type=_content_type,
2597
+ _headers=_headers,
2598
+ _host_index=_host_index
2599
+ )
2600
+
2601
+ _response_types_map: Dict[str, Optional[str]] = {
2602
+ '200': "SearchFilesResponse",
2603
+ }
2604
+ response_data = self.api_client.call_api(
2605
+ *_param,
2606
+ _request_timeout=_request_timeout
2607
+ )
2608
+ response_data.read()
2609
+ return self.api_client.response_deserialize(
2610
+ response_data=response_data,
2611
+ response_types_map=_response_types_map,
2612
+ )
2613
+
2614
+
2615
+ @validate_call
2616
+ def search_files_without_preload_content(
2617
+ self,
2618
+ path: Annotated[StrictStr, Field(description="Directory path to search in")],
2619
+ pattern: Annotated[StrictStr, Field(description="File pattern to match (e.g., *.txt, *.go)")],
2620
+ _request_timeout: Union[
2621
+ None,
2622
+ Annotated[StrictFloat, Field(gt=0)],
2623
+ Tuple[
2624
+ Annotated[StrictFloat, Field(gt=0)],
2625
+ Annotated[StrictFloat, Field(gt=0)]
2626
+ ]
2627
+ ] = None,
2628
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2629
+ _content_type: Optional[StrictStr] = None,
2630
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2631
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2632
+ ) -> RESTResponseType:
2633
+ """Search files by pattern
2634
+
2635
+ Search for files matching a specific pattern in a directory
2636
+
2637
+ :param path: Directory path to search in (required)
2638
+ :type path: str
2639
+ :param pattern: File pattern to match (e.g., *.txt, *.go) (required)
2640
+ :type pattern: str
2641
+ :param _request_timeout: timeout setting for this request. If one
2642
+ number provided, it will be total request
2643
+ timeout. It can also be a pair (tuple) of
2644
+ (connection, read) timeouts.
2645
+ :type _request_timeout: int, tuple(int, int), optional
2646
+ :param _request_auth: set to override the auth_settings for an a single
2647
+ request; this effectively ignores the
2648
+ authentication in the spec for a single request.
2649
+ :type _request_auth: dict, optional
2650
+ :param _content_type: force content-type for the request.
2651
+ :type _content_type: str, Optional
2652
+ :param _headers: set to override the headers for a single
2653
+ request; this effectively ignores the headers
2654
+ in the spec for a single request.
2655
+ :type _headers: dict, optional
2656
+ :param _host_index: set to override the host_index for a single
2657
+ request; this effectively ignores the host_index
2658
+ in the spec for a single request.
2659
+ :type _host_index: int, optional
2660
+ :return: Returns the result object.
2661
+ """ # noqa: E501
2662
+
2663
+ _param = self._search_files_serialize(
2664
+ path=path,
2665
+ pattern=pattern,
2666
+ _request_auth=_request_auth,
2667
+ _content_type=_content_type,
2668
+ _headers=_headers,
2669
+ _host_index=_host_index
2670
+ )
2671
+
2672
+ _response_types_map: Dict[str, Optional[str]] = {
2673
+ '200': "SearchFilesResponse",
2674
+ }
2675
+ response_data = self.api_client.call_api(
2676
+ *_param,
2677
+ _request_timeout=_request_timeout
2678
+ )
2679
+ return response_data.response
2680
+
2681
+
2682
+ def _search_files_serialize(
2683
+ self,
2684
+ path,
2685
+ pattern,
2686
+ _request_auth,
2687
+ _content_type,
2688
+ _headers,
2689
+ _host_index,
2690
+ ) -> RequestSerialized:
2691
+
2692
+ _host = None
2693
+
2694
+ _collection_formats: Dict[str, str] = {
2695
+ }
2696
+
2697
+ _path_params: Dict[str, str] = {}
2698
+ _query_params: List[Tuple[str, str]] = []
2699
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2700
+ _form_params: List[Tuple[str, str]] = []
2701
+ _files: Dict[
2702
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2703
+ ] = {}
2704
+ _body_params: Optional[bytes] = None
2705
+
2706
+ # process the path parameters
2707
+ # process the query parameters
2708
+ if path is not None:
2709
+
2710
+ _query_params.append(('path', path))
2711
+
2712
+ if pattern is not None:
2713
+
2714
+ _query_params.append(('pattern', pattern))
2715
+
2716
+ # process the header parameters
2717
+ # process the form parameters
2718
+ # process the body parameter
2719
+
2720
+
2721
+ # set the HTTP header `Accept`
2722
+ if 'Accept' not in _header_params:
2723
+ _header_params['Accept'] = self.api_client.select_header_accept(
2724
+ [
2725
+ 'application/json'
2726
+ ]
2727
+ )
2728
+
2729
+
2730
+ # authentication setting
2731
+ _auth_settings: List[str] = [
2732
+ ]
2733
+
2734
+ return self.api_client.param_serialize(
2735
+ method='GET',
2736
+ resource_path='/files/search',
2737
+ path_params=_path_params,
2738
+ query_params=_query_params,
2739
+ header_params=_header_params,
2740
+ body=_body_params,
2741
+ post_params=_form_params,
2742
+ files=_files,
2743
+ auth_settings=_auth_settings,
2744
+ collection_formats=_collection_formats,
2745
+ _host=_host,
2746
+ _request_auth=_request_auth
2747
+ )
2748
+
2749
+
2750
+
2751
+
2752
+ @validate_call
2753
+ def set_file_permissions(
2754
+ self,
2755
+ path: Annotated[StrictStr, Field(description="File or directory path")],
2756
+ owner: Annotated[Optional[StrictStr], Field(description="Owner (username or UID)")] = None,
2757
+ group: Annotated[Optional[StrictStr], Field(description="Group (group name or GID)")] = None,
2758
+ mode: Annotated[Optional[StrictStr], Field(description="File mode in octal format (e.g., 0755)")] = None,
2759
+ _request_timeout: Union[
2760
+ None,
2761
+ Annotated[StrictFloat, Field(gt=0)],
2762
+ Tuple[
2763
+ Annotated[StrictFloat, Field(gt=0)],
2764
+ Annotated[StrictFloat, Field(gt=0)]
2765
+ ]
2766
+ ] = None,
2767
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2768
+ _content_type: Optional[StrictStr] = None,
2769
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2770
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2771
+ ) -> None:
2772
+ """Set file permissions
2773
+
2774
+ Set file permissions, ownership, and group for a file or directory
2775
+
2776
+ :param path: File or directory path (required)
2777
+ :type path: str
2778
+ :param owner: Owner (username or UID)
2779
+ :type owner: str
2780
+ :param group: Group (group name or GID)
2781
+ :type group: str
2782
+ :param mode: File mode in octal format (e.g., 0755)
2783
+ :type mode: str
2784
+ :param _request_timeout: timeout setting for this request. If one
2785
+ number provided, it will be total request
2786
+ timeout. It can also be a pair (tuple) of
2787
+ (connection, read) timeouts.
2788
+ :type _request_timeout: int, tuple(int, int), optional
2789
+ :param _request_auth: set to override the auth_settings for an a single
2790
+ request; this effectively ignores the
2791
+ authentication in the spec for a single request.
2792
+ :type _request_auth: dict, optional
2793
+ :param _content_type: force content-type for the request.
2794
+ :type _content_type: str, Optional
2795
+ :param _headers: set to override the headers for a single
2796
+ request; this effectively ignores the headers
2797
+ in the spec for a single request.
2798
+ :type _headers: dict, optional
2799
+ :param _host_index: set to override the host_index for a single
2800
+ request; this effectively ignores the host_index
2801
+ in the spec for a single request.
2802
+ :type _host_index: int, optional
2803
+ :return: Returns the result object.
2804
+ """ # noqa: E501
2805
+
2806
+ _param = self._set_file_permissions_serialize(
2807
+ path=path,
2808
+ owner=owner,
2809
+ group=group,
2810
+ mode=mode,
2811
+ _request_auth=_request_auth,
2812
+ _content_type=_content_type,
2813
+ _headers=_headers,
2814
+ _host_index=_host_index
2815
+ )
2816
+
2817
+ _response_types_map: Dict[str, Optional[str]] = {
2818
+ '200': None,
2819
+ }
2820
+ response_data = self.api_client.call_api(
2821
+ *_param,
2822
+ _request_timeout=_request_timeout
2823
+ )
2824
+ response_data.read()
2825
+ return self.api_client.response_deserialize(
2826
+ response_data=response_data,
2827
+ response_types_map=_response_types_map,
2828
+ ).data
2829
+
2830
+
2831
+ @validate_call
2832
+ def set_file_permissions_with_http_info(
2833
+ self,
2834
+ path: Annotated[StrictStr, Field(description="File or directory path")],
2835
+ owner: Annotated[Optional[StrictStr], Field(description="Owner (username or UID)")] = None,
2836
+ group: Annotated[Optional[StrictStr], Field(description="Group (group name or GID)")] = None,
2837
+ mode: Annotated[Optional[StrictStr], Field(description="File mode in octal format (e.g., 0755)")] = None,
2838
+ _request_timeout: Union[
2839
+ None,
2840
+ Annotated[StrictFloat, Field(gt=0)],
2841
+ Tuple[
2842
+ Annotated[StrictFloat, Field(gt=0)],
2843
+ Annotated[StrictFloat, Field(gt=0)]
2844
+ ]
2845
+ ] = None,
2846
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2847
+ _content_type: Optional[StrictStr] = None,
2848
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2849
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2850
+ ) -> ApiResponse[None]:
2851
+ """Set file permissions
2852
+
2853
+ Set file permissions, ownership, and group for a file or directory
2854
+
2855
+ :param path: File or directory path (required)
2856
+ :type path: str
2857
+ :param owner: Owner (username or UID)
2858
+ :type owner: str
2859
+ :param group: Group (group name or GID)
2860
+ :type group: str
2861
+ :param mode: File mode in octal format (e.g., 0755)
2862
+ :type mode: str
2863
+ :param _request_timeout: timeout setting for this request. If one
2864
+ number provided, it will be total request
2865
+ timeout. It can also be a pair (tuple) of
2866
+ (connection, read) timeouts.
2867
+ :type _request_timeout: int, tuple(int, int), optional
2868
+ :param _request_auth: set to override the auth_settings for an a single
2869
+ request; this effectively ignores the
2870
+ authentication in the spec for a single request.
2871
+ :type _request_auth: dict, optional
2872
+ :param _content_type: force content-type for the request.
2873
+ :type _content_type: str, Optional
2874
+ :param _headers: set to override the headers for a single
2875
+ request; this effectively ignores the headers
2876
+ in the spec for a single request.
2877
+ :type _headers: dict, optional
2878
+ :param _host_index: set to override the host_index for a single
2879
+ request; this effectively ignores the host_index
2880
+ in the spec for a single request.
2881
+ :type _host_index: int, optional
2882
+ :return: Returns the result object.
2883
+ """ # noqa: E501
2884
+
2885
+ _param = self._set_file_permissions_serialize(
2886
+ path=path,
2887
+ owner=owner,
2888
+ group=group,
2889
+ mode=mode,
2890
+ _request_auth=_request_auth,
2891
+ _content_type=_content_type,
2892
+ _headers=_headers,
2893
+ _host_index=_host_index
2894
+ )
2895
+
2896
+ _response_types_map: Dict[str, Optional[str]] = {
2897
+ '200': None,
2898
+ }
2899
+ response_data = self.api_client.call_api(
2900
+ *_param,
2901
+ _request_timeout=_request_timeout
2902
+ )
2903
+ response_data.read()
2904
+ return self.api_client.response_deserialize(
2905
+ response_data=response_data,
2906
+ response_types_map=_response_types_map,
2907
+ )
2908
+
2909
+
2910
+ @validate_call
2911
+ def set_file_permissions_without_preload_content(
2912
+ self,
2913
+ path: Annotated[StrictStr, Field(description="File or directory path")],
2914
+ owner: Annotated[Optional[StrictStr], Field(description="Owner (username or UID)")] = None,
2915
+ group: Annotated[Optional[StrictStr], Field(description="Group (group name or GID)")] = None,
2916
+ mode: Annotated[Optional[StrictStr], Field(description="File mode in octal format (e.g., 0755)")] = None,
2917
+ _request_timeout: Union[
2918
+ None,
2919
+ Annotated[StrictFloat, Field(gt=0)],
2920
+ Tuple[
2921
+ Annotated[StrictFloat, Field(gt=0)],
2922
+ Annotated[StrictFloat, Field(gt=0)]
2923
+ ]
2924
+ ] = None,
2925
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2926
+ _content_type: Optional[StrictStr] = None,
2927
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2928
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2929
+ ) -> RESTResponseType:
2930
+ """Set file permissions
2931
+
2932
+ Set file permissions, ownership, and group for a file or directory
2933
+
2934
+ :param path: File or directory path (required)
2935
+ :type path: str
2936
+ :param owner: Owner (username or UID)
2937
+ :type owner: str
2938
+ :param group: Group (group name or GID)
2939
+ :type group: str
2940
+ :param mode: File mode in octal format (e.g., 0755)
2941
+ :type mode: str
2942
+ :param _request_timeout: timeout setting for this request. If one
2943
+ number provided, it will be total request
2944
+ timeout. It can also be a pair (tuple) of
2945
+ (connection, read) timeouts.
2946
+ :type _request_timeout: int, tuple(int, int), optional
2947
+ :param _request_auth: set to override the auth_settings for an a single
2948
+ request; this effectively ignores the
2949
+ authentication in the spec for a single request.
2950
+ :type _request_auth: dict, optional
2951
+ :param _content_type: force content-type for the request.
2952
+ :type _content_type: str, Optional
2953
+ :param _headers: set to override the headers for a single
2954
+ request; this effectively ignores the headers
2955
+ in the spec for a single request.
2956
+ :type _headers: dict, optional
2957
+ :param _host_index: set to override the host_index for a single
2958
+ request; this effectively ignores the host_index
2959
+ in the spec for a single request.
2960
+ :type _host_index: int, optional
2961
+ :return: Returns the result object.
2962
+ """ # noqa: E501
2963
+
2964
+ _param = self._set_file_permissions_serialize(
2965
+ path=path,
2966
+ owner=owner,
2967
+ group=group,
2968
+ mode=mode,
2969
+ _request_auth=_request_auth,
2970
+ _content_type=_content_type,
2971
+ _headers=_headers,
2972
+ _host_index=_host_index
2973
+ )
2974
+
2975
+ _response_types_map: Dict[str, Optional[str]] = {
2976
+ '200': None,
2977
+ }
2978
+ response_data = self.api_client.call_api(
2979
+ *_param,
2980
+ _request_timeout=_request_timeout
2981
+ )
2982
+ return response_data.response
2983
+
2984
+
2985
+ def _set_file_permissions_serialize(
2986
+ self,
2987
+ path,
2988
+ owner,
2989
+ group,
2990
+ mode,
2991
+ _request_auth,
2992
+ _content_type,
2993
+ _headers,
2994
+ _host_index,
2995
+ ) -> RequestSerialized:
2996
+
2997
+ _host = None
2998
+
2999
+ _collection_formats: Dict[str, str] = {
3000
+ }
3001
+
3002
+ _path_params: Dict[str, str] = {}
3003
+ _query_params: List[Tuple[str, str]] = []
3004
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3005
+ _form_params: List[Tuple[str, str]] = []
3006
+ _files: Dict[
3007
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3008
+ ] = {}
3009
+ _body_params: Optional[bytes] = None
3010
+
3011
+ # process the path parameters
3012
+ # process the query parameters
3013
+ if path is not None:
3014
+
3015
+ _query_params.append(('path', path))
3016
+
3017
+ if owner is not None:
3018
+
3019
+ _query_params.append(('owner', owner))
3020
+
3021
+ if group is not None:
3022
+
3023
+ _query_params.append(('group', group))
3024
+
3025
+ if mode is not None:
3026
+
3027
+ _query_params.append(('mode', mode))
3028
+
3029
+ # process the header parameters
3030
+ # process the form parameters
3031
+ # process the body parameter
3032
+
3033
+
3034
+
3035
+
3036
+ # authentication setting
3037
+ _auth_settings: List[str] = [
3038
+ ]
3039
+
3040
+ return self.api_client.param_serialize(
3041
+ method='POST',
3042
+ resource_path='/files/permissions',
3043
+ path_params=_path_params,
3044
+ query_params=_query_params,
3045
+ header_params=_header_params,
3046
+ body=_body_params,
3047
+ post_params=_form_params,
3048
+ files=_files,
3049
+ auth_settings=_auth_settings,
3050
+ collection_formats=_collection_formats,
3051
+ _host=_host,
3052
+ _request_auth=_request_auth
3053
+ )
3054
+
3055
+
3056
+
3057
+
3058
+ @validate_call
3059
+ def upload_file(
3060
+ self,
3061
+ path: Annotated[StrictStr, Field(description="Destination path for the uploaded file")],
3062
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="File to upload")],
3063
+ _request_timeout: Union[
3064
+ None,
3065
+ Annotated[StrictFloat, Field(gt=0)],
3066
+ Tuple[
3067
+ Annotated[StrictFloat, Field(gt=0)],
3068
+ Annotated[StrictFloat, Field(gt=0)]
3069
+ ]
3070
+ ] = None,
3071
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3072
+ _content_type: Optional[StrictStr] = None,
3073
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3074
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3075
+ ) -> Dict[str, object]:
3076
+ """Upload a file
3077
+
3078
+ Upload a file to the specified path
3079
+
3080
+ :param path: Destination path for the uploaded file (required)
3081
+ :type path: str
3082
+ :param file: File to upload (required)
3083
+ :type file: bytes
3084
+ :param _request_timeout: timeout setting for this request. If one
3085
+ number provided, it will be total request
3086
+ timeout. It can also be a pair (tuple) of
3087
+ (connection, read) timeouts.
3088
+ :type _request_timeout: int, tuple(int, int), optional
3089
+ :param _request_auth: set to override the auth_settings for an a single
3090
+ request; this effectively ignores the
3091
+ authentication in the spec for a single request.
3092
+ :type _request_auth: dict, optional
3093
+ :param _content_type: force content-type for the request.
3094
+ :type _content_type: str, Optional
3095
+ :param _headers: set to override the headers for a single
3096
+ request; this effectively ignores the headers
3097
+ in the spec for a single request.
3098
+ :type _headers: dict, optional
3099
+ :param _host_index: set to override the host_index for a single
3100
+ request; this effectively ignores the host_index
3101
+ in the spec for a single request.
3102
+ :type _host_index: int, optional
3103
+ :return: Returns the result object.
3104
+ """ # noqa: E501
3105
+
3106
+ _param = self._upload_file_serialize(
3107
+ path=path,
3108
+ file=file,
3109
+ _request_auth=_request_auth,
3110
+ _content_type=_content_type,
3111
+ _headers=_headers,
3112
+ _host_index=_host_index
3113
+ )
3114
+
3115
+ _response_types_map: Dict[str, Optional[str]] = {
3116
+ '200': "Dict[str, object]",
3117
+ }
3118
+ response_data = self.api_client.call_api(
3119
+ *_param,
3120
+ _request_timeout=_request_timeout
3121
+ )
3122
+ response_data.read()
3123
+ return self.api_client.response_deserialize(
3124
+ response_data=response_data,
3125
+ response_types_map=_response_types_map,
3126
+ ).data
3127
+
3128
+
3129
+ @validate_call
3130
+ def upload_file_with_http_info(
3131
+ self,
3132
+ path: Annotated[StrictStr, Field(description="Destination path for the uploaded file")],
3133
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="File to upload")],
3134
+ _request_timeout: Union[
3135
+ None,
3136
+ Annotated[StrictFloat, Field(gt=0)],
3137
+ Tuple[
3138
+ Annotated[StrictFloat, Field(gt=0)],
3139
+ Annotated[StrictFloat, Field(gt=0)]
3140
+ ]
3141
+ ] = None,
3142
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3143
+ _content_type: Optional[StrictStr] = None,
3144
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3145
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3146
+ ) -> ApiResponse[Dict[str, object]]:
3147
+ """Upload a file
3148
+
3149
+ Upload a file to the specified path
3150
+
3151
+ :param path: Destination path for the uploaded file (required)
3152
+ :type path: str
3153
+ :param file: File to upload (required)
3154
+ :type file: bytes
3155
+ :param _request_timeout: timeout setting for this request. If one
3156
+ number provided, it will be total request
3157
+ timeout. It can also be a pair (tuple) of
3158
+ (connection, read) timeouts.
3159
+ :type _request_timeout: int, tuple(int, int), optional
3160
+ :param _request_auth: set to override the auth_settings for an a single
3161
+ request; this effectively ignores the
3162
+ authentication in the spec for a single request.
3163
+ :type _request_auth: dict, optional
3164
+ :param _content_type: force content-type for the request.
3165
+ :type _content_type: str, Optional
3166
+ :param _headers: set to override the headers for a single
3167
+ request; this effectively ignores the headers
3168
+ in the spec for a single request.
3169
+ :type _headers: dict, optional
3170
+ :param _host_index: set to override the host_index for a single
3171
+ request; this effectively ignores the host_index
3172
+ in the spec for a single request.
3173
+ :type _host_index: int, optional
3174
+ :return: Returns the result object.
3175
+ """ # noqa: E501
3176
+
3177
+ _param = self._upload_file_serialize(
3178
+ path=path,
3179
+ file=file,
3180
+ _request_auth=_request_auth,
3181
+ _content_type=_content_type,
3182
+ _headers=_headers,
3183
+ _host_index=_host_index
3184
+ )
3185
+
3186
+ _response_types_map: Dict[str, Optional[str]] = {
3187
+ '200': "Dict[str, object]",
3188
+ }
3189
+ response_data = self.api_client.call_api(
3190
+ *_param,
3191
+ _request_timeout=_request_timeout
3192
+ )
3193
+ response_data.read()
3194
+ return self.api_client.response_deserialize(
3195
+ response_data=response_data,
3196
+ response_types_map=_response_types_map,
3197
+ )
3198
+
3199
+
3200
+ @validate_call
3201
+ def upload_file_without_preload_content(
3202
+ self,
3203
+ path: Annotated[StrictStr, Field(description="Destination path for the uploaded file")],
3204
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="File to upload")],
3205
+ _request_timeout: Union[
3206
+ None,
3207
+ Annotated[StrictFloat, Field(gt=0)],
3208
+ Tuple[
3209
+ Annotated[StrictFloat, Field(gt=0)],
3210
+ Annotated[StrictFloat, Field(gt=0)]
3211
+ ]
3212
+ ] = None,
3213
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3214
+ _content_type: Optional[StrictStr] = None,
3215
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3216
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3217
+ ) -> RESTResponseType:
3218
+ """Upload a file
3219
+
3220
+ Upload a file to the specified path
3221
+
3222
+ :param path: Destination path for the uploaded file (required)
3223
+ :type path: str
3224
+ :param file: File to upload (required)
3225
+ :type file: bytes
3226
+ :param _request_timeout: timeout setting for this request. If one
3227
+ number provided, it will be total request
3228
+ timeout. It can also be a pair (tuple) of
3229
+ (connection, read) timeouts.
3230
+ :type _request_timeout: int, tuple(int, int), optional
3231
+ :param _request_auth: set to override the auth_settings for an a single
3232
+ request; this effectively ignores the
3233
+ authentication in the spec for a single request.
3234
+ :type _request_auth: dict, optional
3235
+ :param _content_type: force content-type for the request.
3236
+ :type _content_type: str, Optional
3237
+ :param _headers: set to override the headers for a single
3238
+ request; this effectively ignores the headers
3239
+ in the spec for a single request.
3240
+ :type _headers: dict, optional
3241
+ :param _host_index: set to override the host_index for a single
3242
+ request; this effectively ignores the host_index
3243
+ in the spec for a single request.
3244
+ :type _host_index: int, optional
3245
+ :return: Returns the result object.
3246
+ """ # noqa: E501
3247
+
3248
+ _param = self._upload_file_serialize(
3249
+ path=path,
3250
+ file=file,
3251
+ _request_auth=_request_auth,
3252
+ _content_type=_content_type,
3253
+ _headers=_headers,
3254
+ _host_index=_host_index
3255
+ )
3256
+
3257
+ _response_types_map: Dict[str, Optional[str]] = {
3258
+ '200': "Dict[str, object]",
3259
+ }
3260
+ response_data = self.api_client.call_api(
3261
+ *_param,
3262
+ _request_timeout=_request_timeout
3263
+ )
3264
+ return response_data.response
3265
+
3266
+
3267
+ def _upload_file_serialize(
3268
+ self,
3269
+ path,
3270
+ file,
3271
+ _request_auth,
3272
+ _content_type,
3273
+ _headers,
3274
+ _host_index,
3275
+ ) -> RequestSerialized:
3276
+
3277
+ _host = None
3278
+
3279
+ _collection_formats: Dict[str, str] = {
3280
+ }
3281
+
3282
+ _path_params: Dict[str, str] = {}
3283
+ _query_params: List[Tuple[str, str]] = []
3284
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3285
+ _form_params: List[Tuple[str, str]] = []
3286
+ _files: Dict[
3287
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3288
+ ] = {}
3289
+ _body_params: Optional[bytes] = None
3290
+
3291
+ # process the path parameters
3292
+ # process the query parameters
3293
+ if path is not None:
3294
+
3295
+ _query_params.append(('path', path))
3296
+
3297
+ # process the header parameters
3298
+ # process the form parameters
3299
+ if file is not None:
3300
+ _files['file'] = file
3301
+ # process the body parameter
3302
+
3303
+
3304
+ # set the HTTP header `Accept`
3305
+ if 'Accept' not in _header_params:
3306
+ _header_params['Accept'] = self.api_client.select_header_accept(
3307
+ [
3308
+ '*/*'
3309
+ ]
3310
+ )
3311
+
3312
+ # set the HTTP header `Content-Type`
3313
+ if _content_type:
3314
+ _header_params['Content-Type'] = _content_type
3315
+ else:
3316
+ _default_content_type = (
3317
+ self.api_client.select_header_content_type(
3318
+ [
3319
+ 'multipart/form-data'
3320
+ ]
3321
+ )
3322
+ )
3323
+ if _default_content_type is not None:
3324
+ _header_params['Content-Type'] = _default_content_type
3325
+
3326
+ # authentication setting
3327
+ _auth_settings: List[str] = [
3328
+ ]
3329
+
3330
+ return self.api_client.param_serialize(
3331
+ method='POST',
3332
+ resource_path='/files/upload',
3333
+ path_params=_path_params,
3334
+ query_params=_query_params,
3335
+ header_params=_header_params,
3336
+ body=_body_params,
3337
+ post_params=_form_params,
3338
+ files=_files,
3339
+ auth_settings=_auth_settings,
3340
+ collection_formats=_collection_formats,
3341
+ _host=_host,
3342
+ _request_auth=_request_auth
3343
+ )
3344
+
3345
+
3346
+
3347
+
3348
+ @validate_call
3349
+ def upload_files(
3350
+ self,
3351
+ _request_timeout: Union[
3352
+ None,
3353
+ Annotated[StrictFloat, Field(gt=0)],
3354
+ Tuple[
3355
+ Annotated[StrictFloat, Field(gt=0)],
3356
+ Annotated[StrictFloat, Field(gt=0)]
3357
+ ]
3358
+ ] = None,
3359
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3360
+ _content_type: Optional[StrictStr] = None,
3361
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3362
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3363
+ ) -> None:
3364
+ """Upload multiple files
3365
+
3366
+ Upload multiple files with their destination paths
3367
+
3368
+ :param _request_timeout: timeout setting for this request. If one
3369
+ number provided, it will be total request
3370
+ timeout. It can also be a pair (tuple) of
3371
+ (connection, read) timeouts.
3372
+ :type _request_timeout: int, tuple(int, int), optional
3373
+ :param _request_auth: set to override the auth_settings for an a single
3374
+ request; this effectively ignores the
3375
+ authentication in the spec for a single request.
3376
+ :type _request_auth: dict, optional
3377
+ :param _content_type: force content-type for the request.
3378
+ :type _content_type: str, Optional
3379
+ :param _headers: set to override the headers for a single
3380
+ request; this effectively ignores the headers
3381
+ in the spec for a single request.
3382
+ :type _headers: dict, optional
3383
+ :param _host_index: set to override the host_index for a single
3384
+ request; this effectively ignores the host_index
3385
+ in the spec for a single request.
3386
+ :type _host_index: int, optional
3387
+ :return: Returns the result object.
3388
+ """ # noqa: E501
3389
+
3390
+ _param = self._upload_files_serialize(
3391
+ _request_auth=_request_auth,
3392
+ _content_type=_content_type,
3393
+ _headers=_headers,
3394
+ _host_index=_host_index
3395
+ )
3396
+
3397
+ _response_types_map: Dict[str, Optional[str]] = {
3398
+ '200': None,
3399
+ }
3400
+ response_data = self.api_client.call_api(
3401
+ *_param,
3402
+ _request_timeout=_request_timeout
3403
+ )
3404
+ response_data.read()
3405
+ return self.api_client.response_deserialize(
3406
+ response_data=response_data,
3407
+ response_types_map=_response_types_map,
3408
+ ).data
3409
+
3410
+
3411
+ @validate_call
3412
+ def upload_files_with_http_info(
3413
+ self,
3414
+ _request_timeout: Union[
3415
+ None,
3416
+ Annotated[StrictFloat, Field(gt=0)],
3417
+ Tuple[
3418
+ Annotated[StrictFloat, Field(gt=0)],
3419
+ Annotated[StrictFloat, Field(gt=0)]
3420
+ ]
3421
+ ] = None,
3422
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3423
+ _content_type: Optional[StrictStr] = None,
3424
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3425
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3426
+ ) -> ApiResponse[None]:
3427
+ """Upload multiple files
3428
+
3429
+ Upload multiple files with their destination paths
3430
+
3431
+ :param _request_timeout: timeout setting for this request. If one
3432
+ number provided, it will be total request
3433
+ timeout. It can also be a pair (tuple) of
3434
+ (connection, read) timeouts.
3435
+ :type _request_timeout: int, tuple(int, int), optional
3436
+ :param _request_auth: set to override the auth_settings for an a single
3437
+ request; this effectively ignores the
3438
+ authentication in the spec for a single request.
3439
+ :type _request_auth: dict, optional
3440
+ :param _content_type: force content-type for the request.
3441
+ :type _content_type: str, Optional
3442
+ :param _headers: set to override the headers for a single
3443
+ request; this effectively ignores the headers
3444
+ in the spec for a single request.
3445
+ :type _headers: dict, optional
3446
+ :param _host_index: set to override the host_index for a single
3447
+ request; this effectively ignores the host_index
3448
+ in the spec for a single request.
3449
+ :type _host_index: int, optional
3450
+ :return: Returns the result object.
3451
+ """ # noqa: E501
3452
+
3453
+ _param = self._upload_files_serialize(
3454
+ _request_auth=_request_auth,
3455
+ _content_type=_content_type,
3456
+ _headers=_headers,
3457
+ _host_index=_host_index
3458
+ )
3459
+
3460
+ _response_types_map: Dict[str, Optional[str]] = {
3461
+ '200': None,
3462
+ }
3463
+ response_data = self.api_client.call_api(
3464
+ *_param,
3465
+ _request_timeout=_request_timeout
3466
+ )
3467
+ response_data.read()
3468
+ return self.api_client.response_deserialize(
3469
+ response_data=response_data,
3470
+ response_types_map=_response_types_map,
3471
+ )
3472
+
3473
+
3474
+ @validate_call
3475
+ def upload_files_without_preload_content(
3476
+ self,
3477
+ _request_timeout: Union[
3478
+ None,
3479
+ Annotated[StrictFloat, Field(gt=0)],
3480
+ Tuple[
3481
+ Annotated[StrictFloat, Field(gt=0)],
3482
+ Annotated[StrictFloat, Field(gt=0)]
3483
+ ]
3484
+ ] = None,
3485
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3486
+ _content_type: Optional[StrictStr] = None,
3487
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3488
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3489
+ ) -> RESTResponseType:
3490
+ """Upload multiple files
3491
+
3492
+ Upload multiple files with their destination paths
3493
+
3494
+ :param _request_timeout: timeout setting for this request. If one
3495
+ number provided, it will be total request
3496
+ timeout. It can also be a pair (tuple) of
3497
+ (connection, read) timeouts.
3498
+ :type _request_timeout: int, tuple(int, int), optional
3499
+ :param _request_auth: set to override the auth_settings for an a single
3500
+ request; this effectively ignores the
3501
+ authentication in the spec for a single request.
3502
+ :type _request_auth: dict, optional
3503
+ :param _content_type: force content-type for the request.
3504
+ :type _content_type: str, Optional
3505
+ :param _headers: set to override the headers for a single
3506
+ request; this effectively ignores the headers
3507
+ in the spec for a single request.
3508
+ :type _headers: dict, optional
3509
+ :param _host_index: set to override the host_index for a single
3510
+ request; this effectively ignores the host_index
3511
+ in the spec for a single request.
3512
+ :type _host_index: int, optional
3513
+ :return: Returns the result object.
3514
+ """ # noqa: E501
3515
+
3516
+ _param = self._upload_files_serialize(
3517
+ _request_auth=_request_auth,
3518
+ _content_type=_content_type,
3519
+ _headers=_headers,
3520
+ _host_index=_host_index
3521
+ )
3522
+
3523
+ _response_types_map: Dict[str, Optional[str]] = {
3524
+ '200': None,
3525
+ }
3526
+ response_data = self.api_client.call_api(
3527
+ *_param,
3528
+ _request_timeout=_request_timeout
3529
+ )
3530
+ return response_data.response
3531
+
3532
+
3533
+ def _upload_files_serialize(
3534
+ self,
3535
+ _request_auth,
3536
+ _content_type,
3537
+ _headers,
3538
+ _host_index,
3539
+ ) -> RequestSerialized:
3540
+
3541
+ _host = None
3542
+
3543
+ _collection_formats: Dict[str, str] = {
3544
+ }
3545
+
3546
+ _path_params: Dict[str, str] = {}
3547
+ _query_params: List[Tuple[str, str]] = []
3548
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3549
+ _form_params: List[Tuple[str, str]] = []
3550
+ _files: Dict[
3551
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3552
+ ] = {}
3553
+ _body_params: Optional[bytes] = None
3554
+
3555
+ # process the path parameters
3556
+ # process the query parameters
3557
+ # process the header parameters
3558
+ # process the form parameters
3559
+ # process the body parameter
3560
+
3561
+
3562
+
3563
+
3564
+ # authentication setting
3565
+ _auth_settings: List[str] = [
3566
+ ]
3567
+
3568
+ return self.api_client.param_serialize(
3569
+ method='POST',
3570
+ resource_path='/files/bulk-upload',
3571
+ path_params=_path_params,
3572
+ query_params=_query_params,
3573
+ header_params=_header_params,
3574
+ body=_body_params,
3575
+ post_params=_form_params,
3576
+ files=_files,
3577
+ auth_settings=_auth_settings,
3578
+ collection_formats=_collection_formats,
3579
+ _host=_host,
3580
+ _request_auth=_request_auth
3581
+ )
3582
+
3583
+