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