daytona_toolbox_api_client 0.102.0rc2__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.

Potentially problematic release.


This version of daytona_toolbox_api_client might be problematic. Click here for more details.

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