daytona_toolbox_api_client 0.126.0.alpha.1
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.
- checksums.yaml +7 -0
- data/.gitignore +39 -0
- data/.openapi-generator/FILES +92 -0
- data/.openapi-generator/VERSION +1 -0
- data/.openapi-generator-ignore +12 -0
- data/.rspec +2 -0
- data/.rubocop.yml +148 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +101 -0
- data/Rakefile +10 -0
- data/daytona_toolbox_api_client.gemspec +39 -0
- data/fix-gemspec.sh +13 -0
- data/lib/daytona_toolbox_api_client/api/computer_use_api.rb +1463 -0
- data/lib/daytona_toolbox_api_client/api/file_system_api.rb +893 -0
- data/lib/daytona_toolbox_api_client/api/git_api.rb +744 -0
- data/lib/daytona_toolbox_api_client/api/info_api.rb +193 -0
- data/lib/daytona_toolbox_api_client/api/interpreter_api.rb +267 -0
- data/lib/daytona_toolbox_api_client/api/lsp_api.rb +510 -0
- data/lib/daytona_toolbox_api_client/api/port_api.rb +142 -0
- data/lib/daytona_toolbox_api_client/api/process_api.rb +938 -0
- data/lib/daytona_toolbox_api_client/api_client.rb +392 -0
- data/lib/daytona_toolbox_api_client/api_error.rb +58 -0
- data/lib/daytona_toolbox_api_client/configuration.rb +297 -0
- data/lib/daytona_toolbox_api_client/models/command.rb +270 -0
- data/lib/daytona_toolbox_api_client/models/completion_context.rb +244 -0
- data/lib/daytona_toolbox_api_client/models/completion_item.rb +289 -0
- data/lib/daytona_toolbox_api_client/models/completion_list.rb +263 -0
- data/lib/daytona_toolbox_api_client/models/computer_use_start_response.rb +229 -0
- data/lib/daytona_toolbox_api_client/models/computer_use_status_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/models/computer_use_stop_response.rb +229 -0
- data/lib/daytona_toolbox_api_client/models/create_context_request.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/create_session_request.rb +235 -0
- data/lib/daytona_toolbox_api_client/models/display_info.rb +263 -0
- data/lib/daytona_toolbox_api_client/models/display_info_response.rb +220 -0
- data/lib/daytona_toolbox_api_client/models/execute_request.rb +255 -0
- data/lib/daytona_toolbox_api_client/models/execute_response.rb +244 -0
- data/lib/daytona_toolbox_api_client/models/file_info.rb +417 -0
- data/lib/daytona_toolbox_api_client/models/file_status.rb +335 -0
- data/lib/daytona_toolbox_api_client/models/files_download_request.rb +237 -0
- data/lib/daytona_toolbox_api_client/models/git_add_request.rb +264 -0
- data/lib/daytona_toolbox_api_client/models/git_branch_request.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/git_checkout_request.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/git_clone_request.rb +297 -0
- data/lib/daytona_toolbox_api_client/models/git_commit_info.rb +339 -0
- data/lib/daytona_toolbox_api_client/models/git_commit_request.rb +322 -0
- data/lib/daytona_toolbox_api_client/models/git_commit_response.rb +235 -0
- data/lib/daytona_toolbox_api_client/models/git_git_delete_branch_request.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/git_repo_request.rb +253 -0
- data/lib/daytona_toolbox_api_client/models/git_status.rb +290 -0
- data/lib/daytona_toolbox_api_client/models/interpreter_context.rb +339 -0
- data/lib/daytona_toolbox_api_client/models/is_port_in_use_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/models/keyboard_hotkey_request.rb +219 -0
- data/lib/daytona_toolbox_api_client/models/keyboard_press_request.rb +230 -0
- data/lib/daytona_toolbox_api_client/models/keyboard_type_request.rb +228 -0
- data/lib/daytona_toolbox_api_client/models/list_branch_response.rb +237 -0
- data/lib/daytona_toolbox_api_client/models/list_contexts_response.rb +237 -0
- data/lib/daytona_toolbox_api_client/models/lsp_completion_params.rb +322 -0
- data/lib/daytona_toolbox_api_client/models/lsp_document_request.rb +287 -0
- data/lib/daytona_toolbox_api_client/models/lsp_location.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/lsp_position.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/lsp_range.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/lsp_server_request.rb +261 -0
- data/lib/daytona_toolbox_api_client/models/lsp_symbol.rb +287 -0
- data/lib/daytona_toolbox_api_client/models/match.rb +287 -0
- data/lib/daytona_toolbox_api_client/models/mouse_click_request.rb +246 -0
- data/lib/daytona_toolbox_api_client/models/mouse_click_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/mouse_drag_request.rb +254 -0
- data/lib/daytona_toolbox_api_client/models/mouse_drag_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/mouse_move_request.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/mouse_position_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/mouse_scroll_request.rb +246 -0
- data/lib/daytona_toolbox_api_client/models/port_list.rb +220 -0
- data/lib/daytona_toolbox_api_client/models/position.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/process_errors_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/process_logs_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/process_restart_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/process_status.rb +245 -0
- data/lib/daytona_toolbox_api_client/models/process_status_response.rb +227 -0
- data/lib/daytona_toolbox_api_client/models/pty_create_request.rb +266 -0
- data/lib/daytona_toolbox_api_client/models/pty_create_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/models/pty_list_response.rb +220 -0
- data/lib/daytona_toolbox_api_client/models/pty_resize_request.rb +297 -0
- data/lib/daytona_toolbox_api_client/models/pty_session_info.rb +284 -0
- data/lib/daytona_toolbox_api_client/models/replace_request.rb +289 -0
- data/lib/daytona_toolbox_api_client/models/replace_result.rb +236 -0
- data/lib/daytona_toolbox_api_client/models/screenshot_response.rb +236 -0
- data/lib/daytona_toolbox_api_client/models/scroll_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/models/search_files_response.rb +237 -0
- data/lib/daytona_toolbox_api_client/models/session.rb +263 -0
- data/lib/daytona_toolbox_api_client/models/session_execute_request.rb +253 -0
- data/lib/daytona_toolbox_api_client/models/session_execute_response.rb +254 -0
- data/lib/daytona_toolbox_api_client/models/status.rb +46 -0
- data/lib/daytona_toolbox_api_client/models/user_home_dir_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/models/window_info.rb +272 -0
- data/lib/daytona_toolbox_api_client/models/windows_response.rb +220 -0
- data/lib/daytona_toolbox_api_client/models/work_dir_response.rb +218 -0
- data/lib/daytona_toolbox_api_client/version.rb +15 -0
- data/lib/daytona_toolbox_api_client.rb +120 -0
- data/project.json +65 -0
- metadata +178 -0
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Daytona Daemon API
|
|
3
|
+
|
|
4
|
+
#Daytona Daemon API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v0.0.0-dev
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module DaytonaToolboxApiClient
|
|
16
|
+
class FileSystemApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a folder
|
|
23
|
+
# Create a folder with the specified path and optional permissions
|
|
24
|
+
# @param path [String] Folder path to create
|
|
25
|
+
# @param mode [String] Octal permission mode (default: 0755)
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [nil]
|
|
28
|
+
def create_folder(path, mode, opts = {})
|
|
29
|
+
create_folder_with_http_info(path, mode, opts)
|
|
30
|
+
nil
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a folder
|
|
34
|
+
# Create a folder with the specified path and optional permissions
|
|
35
|
+
# @param path [String] Folder path to create
|
|
36
|
+
# @param mode [String] Octal permission mode (default: 0755)
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
39
|
+
def create_folder_with_http_info(path, mode, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.create_folder ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'path' is set
|
|
44
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.create_folder"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'mode' is set
|
|
48
|
+
if @api_client.config.client_side_validation && mode.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'mode' when calling FileSystemApi.create_folder"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/files/folder'
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
query_params[:'path'] = path
|
|
57
|
+
query_params[:'mode'] = mode
|
|
58
|
+
|
|
59
|
+
# header parameters
|
|
60
|
+
header_params = opts[:header_params] || {}
|
|
61
|
+
|
|
62
|
+
# form parameters
|
|
63
|
+
form_params = opts[:form_params] || {}
|
|
64
|
+
|
|
65
|
+
# http body (model)
|
|
66
|
+
post_body = opts[:debug_body]
|
|
67
|
+
|
|
68
|
+
# return_type
|
|
69
|
+
return_type = opts[:debug_return_type]
|
|
70
|
+
|
|
71
|
+
# auth_names
|
|
72
|
+
auth_names = opts[:debug_auth_names] || []
|
|
73
|
+
|
|
74
|
+
new_options = opts.merge(
|
|
75
|
+
:operation => :"FileSystemApi.create_folder",
|
|
76
|
+
:header_params => header_params,
|
|
77
|
+
:query_params => query_params,
|
|
78
|
+
:form_params => form_params,
|
|
79
|
+
:body => post_body,
|
|
80
|
+
:auth_names => auth_names,
|
|
81
|
+
:return_type => return_type
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
85
|
+
if @api_client.config.debugging
|
|
86
|
+
@api_client.config.logger.debug "API called: FileSystemApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
87
|
+
end
|
|
88
|
+
return data, status_code, headers
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Delete a file or directory
|
|
92
|
+
# Delete a file or directory at the specified path
|
|
93
|
+
# @param path [String] File or directory path to delete
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @option opts [Boolean] :recursive Enable recursive deletion for directories
|
|
96
|
+
# @return [nil]
|
|
97
|
+
def delete_file(path, opts = {})
|
|
98
|
+
delete_file_with_http_info(path, opts)
|
|
99
|
+
nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Delete a file or directory
|
|
103
|
+
# Delete a file or directory at the specified path
|
|
104
|
+
# @param path [String] File or directory path to delete
|
|
105
|
+
# @param [Hash] opts the optional parameters
|
|
106
|
+
# @option opts [Boolean] :recursive Enable recursive deletion for directories
|
|
107
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
108
|
+
def delete_file_with_http_info(path, opts = {})
|
|
109
|
+
if @api_client.config.debugging
|
|
110
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.delete_file ...'
|
|
111
|
+
end
|
|
112
|
+
# verify the required parameter 'path' is set
|
|
113
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
114
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.delete_file"
|
|
115
|
+
end
|
|
116
|
+
# resource path
|
|
117
|
+
local_var_path = '/files'
|
|
118
|
+
|
|
119
|
+
# query parameters
|
|
120
|
+
query_params = opts[:query_params] || {}
|
|
121
|
+
query_params[:'path'] = path
|
|
122
|
+
query_params[:'recursive'] = opts[:'recursive'] if !opts[:'recursive'].nil?
|
|
123
|
+
|
|
124
|
+
# header parameters
|
|
125
|
+
header_params = opts[:header_params] || {}
|
|
126
|
+
|
|
127
|
+
# form parameters
|
|
128
|
+
form_params = opts[:form_params] || {}
|
|
129
|
+
|
|
130
|
+
# http body (model)
|
|
131
|
+
post_body = opts[:debug_body]
|
|
132
|
+
|
|
133
|
+
# return_type
|
|
134
|
+
return_type = opts[:debug_return_type]
|
|
135
|
+
|
|
136
|
+
# auth_names
|
|
137
|
+
auth_names = opts[:debug_auth_names] || []
|
|
138
|
+
|
|
139
|
+
new_options = opts.merge(
|
|
140
|
+
:operation => :"FileSystemApi.delete_file",
|
|
141
|
+
:header_params => header_params,
|
|
142
|
+
:query_params => query_params,
|
|
143
|
+
:form_params => form_params,
|
|
144
|
+
:body => post_body,
|
|
145
|
+
:auth_names => auth_names,
|
|
146
|
+
:return_type => return_type
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
150
|
+
if @api_client.config.debugging
|
|
151
|
+
@api_client.config.logger.debug "API called: FileSystemApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
152
|
+
end
|
|
153
|
+
return data, status_code, headers
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Download a file
|
|
157
|
+
# Download a file by providing its path
|
|
158
|
+
# @param path [String] File path to download
|
|
159
|
+
# @param [Hash] opts the optional parameters
|
|
160
|
+
# @return [File]
|
|
161
|
+
def download_file(path, opts = {})
|
|
162
|
+
data, _status_code, _headers = download_file_with_http_info(path, opts)
|
|
163
|
+
data
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Download a file
|
|
167
|
+
# Download a file by providing its path
|
|
168
|
+
# @param path [String] File path to download
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
|
171
|
+
def download_file_with_http_info(path, opts = {})
|
|
172
|
+
if @api_client.config.debugging
|
|
173
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.download_file ...'
|
|
174
|
+
end
|
|
175
|
+
# verify the required parameter 'path' is set
|
|
176
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
177
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.download_file"
|
|
178
|
+
end
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = '/files/download'
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = opts[:query_params] || {}
|
|
184
|
+
query_params[:'path'] = path
|
|
185
|
+
|
|
186
|
+
# header parameters
|
|
187
|
+
header_params = opts[:header_params] || {}
|
|
188
|
+
# HTTP header 'Accept' (if needed)
|
|
189
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) unless header_params['Accept']
|
|
190
|
+
|
|
191
|
+
# form parameters
|
|
192
|
+
form_params = opts[:form_params] || {}
|
|
193
|
+
|
|
194
|
+
# http body (model)
|
|
195
|
+
post_body = opts[:debug_body]
|
|
196
|
+
|
|
197
|
+
# return_type
|
|
198
|
+
return_type = opts[:debug_return_type] || 'File'
|
|
199
|
+
|
|
200
|
+
# auth_names
|
|
201
|
+
auth_names = opts[:debug_auth_names] || []
|
|
202
|
+
|
|
203
|
+
new_options = opts.merge(
|
|
204
|
+
:operation => :"FileSystemApi.download_file",
|
|
205
|
+
:header_params => header_params,
|
|
206
|
+
:query_params => query_params,
|
|
207
|
+
:form_params => form_params,
|
|
208
|
+
:body => post_body,
|
|
209
|
+
:auth_names => auth_names,
|
|
210
|
+
:return_type => return_type
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
214
|
+
if @api_client.config.debugging
|
|
215
|
+
@api_client.config.logger.debug "API called: FileSystemApi#download_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
216
|
+
end
|
|
217
|
+
return data, status_code, headers
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Download multiple files
|
|
221
|
+
# Download multiple files by providing their paths
|
|
222
|
+
# @param download_files [FilesDownloadRequest] Paths of files to download
|
|
223
|
+
# @param [Hash] opts the optional parameters
|
|
224
|
+
# @return [Hash<String, Object>]
|
|
225
|
+
def download_files(download_files, opts = {})
|
|
226
|
+
data, _status_code, _headers = download_files_with_http_info(download_files, opts)
|
|
227
|
+
data
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Download multiple files
|
|
231
|
+
# Download multiple files by providing their paths
|
|
232
|
+
# @param download_files [FilesDownloadRequest] Paths of files to download
|
|
233
|
+
# @param [Hash] opts the optional parameters
|
|
234
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
235
|
+
def download_files_with_http_info(download_files, opts = {})
|
|
236
|
+
if @api_client.config.debugging
|
|
237
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.download_files ...'
|
|
238
|
+
end
|
|
239
|
+
# verify the required parameter 'download_files' is set
|
|
240
|
+
if @api_client.config.client_side_validation && download_files.nil?
|
|
241
|
+
fail ArgumentError, "Missing the required parameter 'download_files' when calling FileSystemApi.download_files"
|
|
242
|
+
end
|
|
243
|
+
# resource path
|
|
244
|
+
local_var_path = '/files/bulk-download'
|
|
245
|
+
|
|
246
|
+
# query parameters
|
|
247
|
+
query_params = opts[:query_params] || {}
|
|
248
|
+
|
|
249
|
+
# header parameters
|
|
250
|
+
header_params = opts[:header_params] || {}
|
|
251
|
+
# HTTP header 'Accept' (if needed)
|
|
252
|
+
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data']) unless header_params['Accept']
|
|
253
|
+
# HTTP header 'Content-Type'
|
|
254
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
255
|
+
if !content_type.nil?
|
|
256
|
+
header_params['Content-Type'] = content_type
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# form parameters
|
|
260
|
+
form_params = opts[:form_params] || {}
|
|
261
|
+
|
|
262
|
+
# http body (model)
|
|
263
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(download_files)
|
|
264
|
+
|
|
265
|
+
# return_type
|
|
266
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
267
|
+
|
|
268
|
+
# auth_names
|
|
269
|
+
auth_names = opts[:debug_auth_names] || []
|
|
270
|
+
|
|
271
|
+
new_options = opts.merge(
|
|
272
|
+
:operation => :"FileSystemApi.download_files",
|
|
273
|
+
:header_params => header_params,
|
|
274
|
+
:query_params => query_params,
|
|
275
|
+
:form_params => form_params,
|
|
276
|
+
:body => post_body,
|
|
277
|
+
:auth_names => auth_names,
|
|
278
|
+
:return_type => return_type
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
282
|
+
if @api_client.config.debugging
|
|
283
|
+
@api_client.config.logger.debug "API called: FileSystemApi#download_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
284
|
+
end
|
|
285
|
+
return data, status_code, headers
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Find text in files
|
|
289
|
+
# Search for text pattern within files in a directory
|
|
290
|
+
# @param path [String] Directory path to search in
|
|
291
|
+
# @param pattern [String] Text pattern to search for
|
|
292
|
+
# @param [Hash] opts the optional parameters
|
|
293
|
+
# @return [Array<Match>]
|
|
294
|
+
def find_in_files(path, pattern, opts = {})
|
|
295
|
+
data, _status_code, _headers = find_in_files_with_http_info(path, pattern, opts)
|
|
296
|
+
data
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Find text in files
|
|
300
|
+
# Search for text pattern within files in a directory
|
|
301
|
+
# @param path [String] Directory path to search in
|
|
302
|
+
# @param pattern [String] Text pattern to search for
|
|
303
|
+
# @param [Hash] opts the optional parameters
|
|
304
|
+
# @return [Array<(Array<Match>, Integer, Hash)>] Array<Match> data, response status code and response headers
|
|
305
|
+
def find_in_files_with_http_info(path, pattern, opts = {})
|
|
306
|
+
if @api_client.config.debugging
|
|
307
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.find_in_files ...'
|
|
308
|
+
end
|
|
309
|
+
# verify the required parameter 'path' is set
|
|
310
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
311
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.find_in_files"
|
|
312
|
+
end
|
|
313
|
+
# verify the required parameter 'pattern' is set
|
|
314
|
+
if @api_client.config.client_side_validation && pattern.nil?
|
|
315
|
+
fail ArgumentError, "Missing the required parameter 'pattern' when calling FileSystemApi.find_in_files"
|
|
316
|
+
end
|
|
317
|
+
# resource path
|
|
318
|
+
local_var_path = '/files/find'
|
|
319
|
+
|
|
320
|
+
# query parameters
|
|
321
|
+
query_params = opts[:query_params] || {}
|
|
322
|
+
query_params[:'path'] = path
|
|
323
|
+
query_params[:'pattern'] = pattern
|
|
324
|
+
|
|
325
|
+
# header parameters
|
|
326
|
+
header_params = opts[:header_params] || {}
|
|
327
|
+
# HTTP header 'Accept' (if needed)
|
|
328
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
329
|
+
|
|
330
|
+
# form parameters
|
|
331
|
+
form_params = opts[:form_params] || {}
|
|
332
|
+
|
|
333
|
+
# http body (model)
|
|
334
|
+
post_body = opts[:debug_body]
|
|
335
|
+
|
|
336
|
+
# return_type
|
|
337
|
+
return_type = opts[:debug_return_type] || 'Array<Match>'
|
|
338
|
+
|
|
339
|
+
# auth_names
|
|
340
|
+
auth_names = opts[:debug_auth_names] || []
|
|
341
|
+
|
|
342
|
+
new_options = opts.merge(
|
|
343
|
+
:operation => :"FileSystemApi.find_in_files",
|
|
344
|
+
:header_params => header_params,
|
|
345
|
+
:query_params => query_params,
|
|
346
|
+
:form_params => form_params,
|
|
347
|
+
:body => post_body,
|
|
348
|
+
:auth_names => auth_names,
|
|
349
|
+
:return_type => return_type
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
353
|
+
if @api_client.config.debugging
|
|
354
|
+
@api_client.config.logger.debug "API called: FileSystemApi#find_in_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
355
|
+
end
|
|
356
|
+
return data, status_code, headers
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Get file information
|
|
360
|
+
# Get detailed information about a file or directory
|
|
361
|
+
# @param path [String] File or directory path
|
|
362
|
+
# @param [Hash] opts the optional parameters
|
|
363
|
+
# @return [FileInfo]
|
|
364
|
+
def get_file_info(path, opts = {})
|
|
365
|
+
data, _status_code, _headers = get_file_info_with_http_info(path, opts)
|
|
366
|
+
data
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# Get file information
|
|
370
|
+
# Get detailed information about a file or directory
|
|
371
|
+
# @param path [String] File or directory path
|
|
372
|
+
# @param [Hash] opts the optional parameters
|
|
373
|
+
# @return [Array<(FileInfo, Integer, Hash)>] FileInfo data, response status code and response headers
|
|
374
|
+
def get_file_info_with_http_info(path, opts = {})
|
|
375
|
+
if @api_client.config.debugging
|
|
376
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.get_file_info ...'
|
|
377
|
+
end
|
|
378
|
+
# verify the required parameter 'path' is set
|
|
379
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
380
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.get_file_info"
|
|
381
|
+
end
|
|
382
|
+
# resource path
|
|
383
|
+
local_var_path = '/files/info'
|
|
384
|
+
|
|
385
|
+
# query parameters
|
|
386
|
+
query_params = opts[:query_params] || {}
|
|
387
|
+
query_params[:'path'] = path
|
|
388
|
+
|
|
389
|
+
# header parameters
|
|
390
|
+
header_params = opts[:header_params] || {}
|
|
391
|
+
# HTTP header 'Accept' (if needed)
|
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
393
|
+
|
|
394
|
+
# form parameters
|
|
395
|
+
form_params = opts[:form_params] || {}
|
|
396
|
+
|
|
397
|
+
# http body (model)
|
|
398
|
+
post_body = opts[:debug_body]
|
|
399
|
+
|
|
400
|
+
# return_type
|
|
401
|
+
return_type = opts[:debug_return_type] || 'FileInfo'
|
|
402
|
+
|
|
403
|
+
# auth_names
|
|
404
|
+
auth_names = opts[:debug_auth_names] || []
|
|
405
|
+
|
|
406
|
+
new_options = opts.merge(
|
|
407
|
+
:operation => :"FileSystemApi.get_file_info",
|
|
408
|
+
:header_params => header_params,
|
|
409
|
+
:query_params => query_params,
|
|
410
|
+
:form_params => form_params,
|
|
411
|
+
:body => post_body,
|
|
412
|
+
:auth_names => auth_names,
|
|
413
|
+
:return_type => return_type
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
417
|
+
if @api_client.config.debugging
|
|
418
|
+
@api_client.config.logger.debug "API called: FileSystemApi#get_file_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
419
|
+
end
|
|
420
|
+
return data, status_code, headers
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# List files and directories
|
|
424
|
+
# List files and directories in the specified path
|
|
425
|
+
# @param [Hash] opts the optional parameters
|
|
426
|
+
# @option opts [String] :path Directory path to list (defaults to working directory)
|
|
427
|
+
# @return [Array<FileInfo>]
|
|
428
|
+
def list_files(opts = {})
|
|
429
|
+
data, _status_code, _headers = list_files_with_http_info(opts)
|
|
430
|
+
data
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# List files and directories
|
|
434
|
+
# List files and directories in the specified path
|
|
435
|
+
# @param [Hash] opts the optional parameters
|
|
436
|
+
# @option opts [String] :path Directory path to list (defaults to working directory)
|
|
437
|
+
# @return [Array<(Array<FileInfo>, Integer, Hash)>] Array<FileInfo> data, response status code and response headers
|
|
438
|
+
def list_files_with_http_info(opts = {})
|
|
439
|
+
if @api_client.config.debugging
|
|
440
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.list_files ...'
|
|
441
|
+
end
|
|
442
|
+
# resource path
|
|
443
|
+
local_var_path = '/files'
|
|
444
|
+
|
|
445
|
+
# query parameters
|
|
446
|
+
query_params = opts[:query_params] || {}
|
|
447
|
+
query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
|
|
448
|
+
|
|
449
|
+
# header parameters
|
|
450
|
+
header_params = opts[:header_params] || {}
|
|
451
|
+
# HTTP header 'Accept' (if needed)
|
|
452
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
453
|
+
|
|
454
|
+
# form parameters
|
|
455
|
+
form_params = opts[:form_params] || {}
|
|
456
|
+
|
|
457
|
+
# http body (model)
|
|
458
|
+
post_body = opts[:debug_body]
|
|
459
|
+
|
|
460
|
+
# return_type
|
|
461
|
+
return_type = opts[:debug_return_type] || 'Array<FileInfo>'
|
|
462
|
+
|
|
463
|
+
# auth_names
|
|
464
|
+
auth_names = opts[:debug_auth_names] || []
|
|
465
|
+
|
|
466
|
+
new_options = opts.merge(
|
|
467
|
+
:operation => :"FileSystemApi.list_files",
|
|
468
|
+
:header_params => header_params,
|
|
469
|
+
:query_params => query_params,
|
|
470
|
+
:form_params => form_params,
|
|
471
|
+
:body => post_body,
|
|
472
|
+
:auth_names => auth_names,
|
|
473
|
+
:return_type => return_type
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
477
|
+
if @api_client.config.debugging
|
|
478
|
+
@api_client.config.logger.debug "API called: FileSystemApi#list_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
479
|
+
end
|
|
480
|
+
return data, status_code, headers
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
# Move or rename file/directory
|
|
484
|
+
# Move or rename a file or directory from source to destination
|
|
485
|
+
# @param source [String] Source file or directory path
|
|
486
|
+
# @param destination [String] Destination file or directory path
|
|
487
|
+
# @param [Hash] opts the optional parameters
|
|
488
|
+
# @return [nil]
|
|
489
|
+
def move_file(source, destination, opts = {})
|
|
490
|
+
move_file_with_http_info(source, destination, opts)
|
|
491
|
+
nil
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
# Move or rename file/directory
|
|
495
|
+
# Move or rename a file or directory from source to destination
|
|
496
|
+
# @param source [String] Source file or directory path
|
|
497
|
+
# @param destination [String] Destination file or directory path
|
|
498
|
+
# @param [Hash] opts the optional parameters
|
|
499
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
500
|
+
def move_file_with_http_info(source, destination, opts = {})
|
|
501
|
+
if @api_client.config.debugging
|
|
502
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.move_file ...'
|
|
503
|
+
end
|
|
504
|
+
# verify the required parameter 'source' is set
|
|
505
|
+
if @api_client.config.client_side_validation && source.nil?
|
|
506
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling FileSystemApi.move_file"
|
|
507
|
+
end
|
|
508
|
+
# verify the required parameter 'destination' is set
|
|
509
|
+
if @api_client.config.client_side_validation && destination.nil?
|
|
510
|
+
fail ArgumentError, "Missing the required parameter 'destination' when calling FileSystemApi.move_file"
|
|
511
|
+
end
|
|
512
|
+
# resource path
|
|
513
|
+
local_var_path = '/files/move'
|
|
514
|
+
|
|
515
|
+
# query parameters
|
|
516
|
+
query_params = opts[:query_params] || {}
|
|
517
|
+
query_params[:'source'] = source
|
|
518
|
+
query_params[:'destination'] = destination
|
|
519
|
+
|
|
520
|
+
# header parameters
|
|
521
|
+
header_params = opts[:header_params] || {}
|
|
522
|
+
|
|
523
|
+
# form parameters
|
|
524
|
+
form_params = opts[:form_params] || {}
|
|
525
|
+
|
|
526
|
+
# http body (model)
|
|
527
|
+
post_body = opts[:debug_body]
|
|
528
|
+
|
|
529
|
+
# return_type
|
|
530
|
+
return_type = opts[:debug_return_type]
|
|
531
|
+
|
|
532
|
+
# auth_names
|
|
533
|
+
auth_names = opts[:debug_auth_names] || []
|
|
534
|
+
|
|
535
|
+
new_options = opts.merge(
|
|
536
|
+
:operation => :"FileSystemApi.move_file",
|
|
537
|
+
:header_params => header_params,
|
|
538
|
+
:query_params => query_params,
|
|
539
|
+
:form_params => form_params,
|
|
540
|
+
:body => post_body,
|
|
541
|
+
:auth_names => auth_names,
|
|
542
|
+
:return_type => return_type
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
546
|
+
if @api_client.config.debugging
|
|
547
|
+
@api_client.config.logger.debug "API called: FileSystemApi#move_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
548
|
+
end
|
|
549
|
+
return data, status_code, headers
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
# Replace text in files
|
|
553
|
+
# Replace text pattern with new value in multiple files
|
|
554
|
+
# @param request [ReplaceRequest] Replace request
|
|
555
|
+
# @param [Hash] opts the optional parameters
|
|
556
|
+
# @return [Array<ReplaceResult>]
|
|
557
|
+
def replace_in_files(request, opts = {})
|
|
558
|
+
data, _status_code, _headers = replace_in_files_with_http_info(request, opts)
|
|
559
|
+
data
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
# Replace text in files
|
|
563
|
+
# Replace text pattern with new value in multiple files
|
|
564
|
+
# @param request [ReplaceRequest] Replace request
|
|
565
|
+
# @param [Hash] opts the optional parameters
|
|
566
|
+
# @return [Array<(Array<ReplaceResult>, Integer, Hash)>] Array<ReplaceResult> data, response status code and response headers
|
|
567
|
+
def replace_in_files_with_http_info(request, opts = {})
|
|
568
|
+
if @api_client.config.debugging
|
|
569
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.replace_in_files ...'
|
|
570
|
+
end
|
|
571
|
+
# verify the required parameter 'request' is set
|
|
572
|
+
if @api_client.config.client_side_validation && request.nil?
|
|
573
|
+
fail ArgumentError, "Missing the required parameter 'request' when calling FileSystemApi.replace_in_files"
|
|
574
|
+
end
|
|
575
|
+
# resource path
|
|
576
|
+
local_var_path = '/files/replace'
|
|
577
|
+
|
|
578
|
+
# query parameters
|
|
579
|
+
query_params = opts[:query_params] || {}
|
|
580
|
+
|
|
581
|
+
# header parameters
|
|
582
|
+
header_params = opts[:header_params] || {}
|
|
583
|
+
# HTTP header 'Accept' (if needed)
|
|
584
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
585
|
+
# HTTP header 'Content-Type'
|
|
586
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
587
|
+
if !content_type.nil?
|
|
588
|
+
header_params['Content-Type'] = content_type
|
|
589
|
+
end
|
|
590
|
+
|
|
591
|
+
# form parameters
|
|
592
|
+
form_params = opts[:form_params] || {}
|
|
593
|
+
|
|
594
|
+
# http body (model)
|
|
595
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(request)
|
|
596
|
+
|
|
597
|
+
# return_type
|
|
598
|
+
return_type = opts[:debug_return_type] || 'Array<ReplaceResult>'
|
|
599
|
+
|
|
600
|
+
# auth_names
|
|
601
|
+
auth_names = opts[:debug_auth_names] || []
|
|
602
|
+
|
|
603
|
+
new_options = opts.merge(
|
|
604
|
+
:operation => :"FileSystemApi.replace_in_files",
|
|
605
|
+
:header_params => header_params,
|
|
606
|
+
:query_params => query_params,
|
|
607
|
+
:form_params => form_params,
|
|
608
|
+
:body => post_body,
|
|
609
|
+
:auth_names => auth_names,
|
|
610
|
+
:return_type => return_type
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
614
|
+
if @api_client.config.debugging
|
|
615
|
+
@api_client.config.logger.debug "API called: FileSystemApi#replace_in_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
616
|
+
end
|
|
617
|
+
return data, status_code, headers
|
|
618
|
+
end
|
|
619
|
+
|
|
620
|
+
# Search files by pattern
|
|
621
|
+
# Search for files matching a specific pattern in a directory
|
|
622
|
+
# @param path [String] Directory path to search in
|
|
623
|
+
# @param pattern [String] File pattern to match (e.g., *.txt, *.go)
|
|
624
|
+
# @param [Hash] opts the optional parameters
|
|
625
|
+
# @return [SearchFilesResponse]
|
|
626
|
+
def search_files(path, pattern, opts = {})
|
|
627
|
+
data, _status_code, _headers = search_files_with_http_info(path, pattern, opts)
|
|
628
|
+
data
|
|
629
|
+
end
|
|
630
|
+
|
|
631
|
+
# Search files by pattern
|
|
632
|
+
# Search for files matching a specific pattern in a directory
|
|
633
|
+
# @param path [String] Directory path to search in
|
|
634
|
+
# @param pattern [String] File pattern to match (e.g., *.txt, *.go)
|
|
635
|
+
# @param [Hash] opts the optional parameters
|
|
636
|
+
# @return [Array<(SearchFilesResponse, Integer, Hash)>] SearchFilesResponse data, response status code and response headers
|
|
637
|
+
def search_files_with_http_info(path, pattern, opts = {})
|
|
638
|
+
if @api_client.config.debugging
|
|
639
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.search_files ...'
|
|
640
|
+
end
|
|
641
|
+
# verify the required parameter 'path' is set
|
|
642
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
643
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.search_files"
|
|
644
|
+
end
|
|
645
|
+
# verify the required parameter 'pattern' is set
|
|
646
|
+
if @api_client.config.client_side_validation && pattern.nil?
|
|
647
|
+
fail ArgumentError, "Missing the required parameter 'pattern' when calling FileSystemApi.search_files"
|
|
648
|
+
end
|
|
649
|
+
# resource path
|
|
650
|
+
local_var_path = '/files/search'
|
|
651
|
+
|
|
652
|
+
# query parameters
|
|
653
|
+
query_params = opts[:query_params] || {}
|
|
654
|
+
query_params[:'path'] = path
|
|
655
|
+
query_params[:'pattern'] = pattern
|
|
656
|
+
|
|
657
|
+
# header parameters
|
|
658
|
+
header_params = opts[:header_params] || {}
|
|
659
|
+
# HTTP header 'Accept' (if needed)
|
|
660
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
661
|
+
|
|
662
|
+
# form parameters
|
|
663
|
+
form_params = opts[:form_params] || {}
|
|
664
|
+
|
|
665
|
+
# http body (model)
|
|
666
|
+
post_body = opts[:debug_body]
|
|
667
|
+
|
|
668
|
+
# return_type
|
|
669
|
+
return_type = opts[:debug_return_type] || 'SearchFilesResponse'
|
|
670
|
+
|
|
671
|
+
# auth_names
|
|
672
|
+
auth_names = opts[:debug_auth_names] || []
|
|
673
|
+
|
|
674
|
+
new_options = opts.merge(
|
|
675
|
+
:operation => :"FileSystemApi.search_files",
|
|
676
|
+
:header_params => header_params,
|
|
677
|
+
:query_params => query_params,
|
|
678
|
+
:form_params => form_params,
|
|
679
|
+
:body => post_body,
|
|
680
|
+
:auth_names => auth_names,
|
|
681
|
+
:return_type => return_type
|
|
682
|
+
)
|
|
683
|
+
|
|
684
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
685
|
+
if @api_client.config.debugging
|
|
686
|
+
@api_client.config.logger.debug "API called: FileSystemApi#search_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
687
|
+
end
|
|
688
|
+
return data, status_code, headers
|
|
689
|
+
end
|
|
690
|
+
|
|
691
|
+
# Set file permissions
|
|
692
|
+
# Set file permissions, ownership, and group for a file or directory
|
|
693
|
+
# @param path [String] File or directory path
|
|
694
|
+
# @param [Hash] opts the optional parameters
|
|
695
|
+
# @option opts [String] :owner Owner (username or UID)
|
|
696
|
+
# @option opts [String] :group Group (group name or GID)
|
|
697
|
+
# @option opts [String] :mode File mode in octal format (e.g., 0755)
|
|
698
|
+
# @return [nil]
|
|
699
|
+
def set_file_permissions(path, opts = {})
|
|
700
|
+
set_file_permissions_with_http_info(path, opts)
|
|
701
|
+
nil
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
# Set file permissions
|
|
705
|
+
# Set file permissions, ownership, and group for a file or directory
|
|
706
|
+
# @param path [String] File or directory path
|
|
707
|
+
# @param [Hash] opts the optional parameters
|
|
708
|
+
# @option opts [String] :owner Owner (username or UID)
|
|
709
|
+
# @option opts [String] :group Group (group name or GID)
|
|
710
|
+
# @option opts [String] :mode File mode in octal format (e.g., 0755)
|
|
711
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
712
|
+
def set_file_permissions_with_http_info(path, opts = {})
|
|
713
|
+
if @api_client.config.debugging
|
|
714
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.set_file_permissions ...'
|
|
715
|
+
end
|
|
716
|
+
# verify the required parameter 'path' is set
|
|
717
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
718
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.set_file_permissions"
|
|
719
|
+
end
|
|
720
|
+
# resource path
|
|
721
|
+
local_var_path = '/files/permissions'
|
|
722
|
+
|
|
723
|
+
# query parameters
|
|
724
|
+
query_params = opts[:query_params] || {}
|
|
725
|
+
query_params[:'path'] = path
|
|
726
|
+
query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].nil?
|
|
727
|
+
query_params[:'group'] = opts[:'group'] if !opts[:'group'].nil?
|
|
728
|
+
query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
|
|
729
|
+
|
|
730
|
+
# header parameters
|
|
731
|
+
header_params = opts[:header_params] || {}
|
|
732
|
+
|
|
733
|
+
# form parameters
|
|
734
|
+
form_params = opts[:form_params] || {}
|
|
735
|
+
|
|
736
|
+
# http body (model)
|
|
737
|
+
post_body = opts[:debug_body]
|
|
738
|
+
|
|
739
|
+
# return_type
|
|
740
|
+
return_type = opts[:debug_return_type]
|
|
741
|
+
|
|
742
|
+
# auth_names
|
|
743
|
+
auth_names = opts[:debug_auth_names] || []
|
|
744
|
+
|
|
745
|
+
new_options = opts.merge(
|
|
746
|
+
:operation => :"FileSystemApi.set_file_permissions",
|
|
747
|
+
:header_params => header_params,
|
|
748
|
+
:query_params => query_params,
|
|
749
|
+
:form_params => form_params,
|
|
750
|
+
:body => post_body,
|
|
751
|
+
:auth_names => auth_names,
|
|
752
|
+
:return_type => return_type
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
756
|
+
if @api_client.config.debugging
|
|
757
|
+
@api_client.config.logger.debug "API called: FileSystemApi#set_file_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
758
|
+
end
|
|
759
|
+
return data, status_code, headers
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
# Upload a file
|
|
763
|
+
# Upload a file to the specified path
|
|
764
|
+
# @param path [String] Destination path for the uploaded file
|
|
765
|
+
# @param file [File] File to upload
|
|
766
|
+
# @param [Hash] opts the optional parameters
|
|
767
|
+
# @return [Hash<String, Object>]
|
|
768
|
+
def upload_file(path, file, opts = {})
|
|
769
|
+
data, _status_code, _headers = upload_file_with_http_info(path, file, opts)
|
|
770
|
+
data
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
# Upload a file
|
|
774
|
+
# Upload a file to the specified path
|
|
775
|
+
# @param path [String] Destination path for the uploaded file
|
|
776
|
+
# @param file [File] File to upload
|
|
777
|
+
# @param [Hash] opts the optional parameters
|
|
778
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
779
|
+
def upload_file_with_http_info(path, file, opts = {})
|
|
780
|
+
if @api_client.config.debugging
|
|
781
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.upload_file ...'
|
|
782
|
+
end
|
|
783
|
+
# verify the required parameter 'path' is set
|
|
784
|
+
if @api_client.config.client_side_validation && path.nil?
|
|
785
|
+
fail ArgumentError, "Missing the required parameter 'path' when calling FileSystemApi.upload_file"
|
|
786
|
+
end
|
|
787
|
+
# verify the required parameter 'file' is set
|
|
788
|
+
if @api_client.config.client_side_validation && file.nil?
|
|
789
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling FileSystemApi.upload_file"
|
|
790
|
+
end
|
|
791
|
+
# resource path
|
|
792
|
+
local_var_path = '/files/upload'
|
|
793
|
+
|
|
794
|
+
# query parameters
|
|
795
|
+
query_params = opts[:query_params] || {}
|
|
796
|
+
query_params[:'path'] = path
|
|
797
|
+
|
|
798
|
+
# header parameters
|
|
799
|
+
header_params = opts[:header_params] || {}
|
|
800
|
+
# HTTP header 'Accept' (if needed)
|
|
801
|
+
header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept']
|
|
802
|
+
# HTTP header 'Content-Type'
|
|
803
|
+
content_type = @api_client.select_header_content_type(['multipart/form-data'])
|
|
804
|
+
if !content_type.nil?
|
|
805
|
+
header_params['Content-Type'] = content_type
|
|
806
|
+
end
|
|
807
|
+
|
|
808
|
+
# form parameters
|
|
809
|
+
form_params = opts[:form_params] || {}
|
|
810
|
+
form_params['file'] = file
|
|
811
|
+
|
|
812
|
+
# http body (model)
|
|
813
|
+
post_body = opts[:debug_body]
|
|
814
|
+
|
|
815
|
+
# return_type
|
|
816
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
|
817
|
+
|
|
818
|
+
# auth_names
|
|
819
|
+
auth_names = opts[:debug_auth_names] || []
|
|
820
|
+
|
|
821
|
+
new_options = opts.merge(
|
|
822
|
+
:operation => :"FileSystemApi.upload_file",
|
|
823
|
+
:header_params => header_params,
|
|
824
|
+
:query_params => query_params,
|
|
825
|
+
:form_params => form_params,
|
|
826
|
+
:body => post_body,
|
|
827
|
+
:auth_names => auth_names,
|
|
828
|
+
:return_type => return_type
|
|
829
|
+
)
|
|
830
|
+
|
|
831
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
832
|
+
if @api_client.config.debugging
|
|
833
|
+
@api_client.config.logger.debug "API called: FileSystemApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
834
|
+
end
|
|
835
|
+
return data, status_code, headers
|
|
836
|
+
end
|
|
837
|
+
|
|
838
|
+
# Upload multiple files
|
|
839
|
+
# Upload multiple files with their destination paths
|
|
840
|
+
# @param [Hash] opts the optional parameters
|
|
841
|
+
# @return [nil]
|
|
842
|
+
def upload_files(opts = {})
|
|
843
|
+
upload_files_with_http_info(opts)
|
|
844
|
+
nil
|
|
845
|
+
end
|
|
846
|
+
|
|
847
|
+
# Upload multiple files
|
|
848
|
+
# Upload multiple files with their destination paths
|
|
849
|
+
# @param [Hash] opts the optional parameters
|
|
850
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
851
|
+
def upload_files_with_http_info(opts = {})
|
|
852
|
+
if @api_client.config.debugging
|
|
853
|
+
@api_client.config.logger.debug 'Calling API: FileSystemApi.upload_files ...'
|
|
854
|
+
end
|
|
855
|
+
# resource path
|
|
856
|
+
local_var_path = '/files/bulk-upload'
|
|
857
|
+
|
|
858
|
+
# query parameters
|
|
859
|
+
query_params = opts[:query_params] || {}
|
|
860
|
+
|
|
861
|
+
# header parameters
|
|
862
|
+
header_params = opts[:header_params] || {}
|
|
863
|
+
|
|
864
|
+
# form parameters
|
|
865
|
+
form_params = opts[:form_params] || {}
|
|
866
|
+
|
|
867
|
+
# http body (model)
|
|
868
|
+
post_body = opts[:debug_body]
|
|
869
|
+
|
|
870
|
+
# return_type
|
|
871
|
+
return_type = opts[:debug_return_type]
|
|
872
|
+
|
|
873
|
+
# auth_names
|
|
874
|
+
auth_names = opts[:debug_auth_names] || []
|
|
875
|
+
|
|
876
|
+
new_options = opts.merge(
|
|
877
|
+
:operation => :"FileSystemApi.upload_files",
|
|
878
|
+
:header_params => header_params,
|
|
879
|
+
:query_params => query_params,
|
|
880
|
+
:form_params => form_params,
|
|
881
|
+
:body => post_body,
|
|
882
|
+
:auth_names => auth_names,
|
|
883
|
+
:return_type => return_type
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
887
|
+
if @api_client.config.debugging
|
|
888
|
+
@api_client.config.logger.debug "API called: FileSystemApi#upload_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
889
|
+
end
|
|
890
|
+
return data, status_code, headers
|
|
891
|
+
end
|
|
892
|
+
end
|
|
893
|
+
end
|