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