Class: ZSGFClient::FileApi
- Inherits:
-
Object
- Object
- ZSGFClient::FileApi
- Defined in:
- lib/zsgf_client/api/file_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#file_create_folder(app_key, opts = {}) ⇒ BooleanApiResponse
创建文件夹 在指定路径创建文件夹.
-
#file_create_folder_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
创建文件夹 在指定路径创建文件夹.
-
#file_delete(app_key, opts = {}) ⇒ BooleanApiResponse
删除文件 / 文件夹 根据指定路径删除文件或文件夹.
-
#file_delete_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
删除文件 / 文件夹 根据指定路径删除文件或文件夹.
-
#file_rename(app_key, opts = {}) ⇒ BooleanApiResponse
重命名文件 / 文件夹 将指定的文件或文件夹重命名.
-
#file_rename_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
重命名文件 / 文件夹 将指定的文件或文件夹重命名.
-
#file_upload(app_key, opts = {}) ⇒ StringApiResponse
上传文件 将文件上传到指定路径.
-
#file_upload_with_http_info(app_key, opts = {}) ⇒ Array<(StringApiResponse, Integer, Hash)>
上传文件 将文件上传到指定路径.
-
#files(app_key, opts = {}) ⇒ FileListResultApiResponse
获取文件列表 根据指定路径获取文件和文件夹列表.
-
#files_with_http_info(app_key, opts = {}) ⇒ Array<(FileListResultApiResponse, Integer, Hash)>
获取文件列表 根据指定路径获取文件和文件夹列表.
-
#initialize(api_client = ApiClient.default) ⇒ FileApi
constructor
A new instance of FileApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zsgf_client/api/file_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#file_create_folder(app_key, opts = {}) ⇒ BooleanApiResponse
创建文件夹在指定路径创建文件夹
28 29 30 31 |
# File 'lib/zsgf_client/api/file_api.rb', line 28 def file_create_folder(app_key, opts = {}) data, _status_code, _headers = file_create_folder_with_http_info(app_key, opts) data end |
#file_create_folder_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
创建文件夹在指定路径创建文件夹
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/zsgf_client/api/file_api.rb', line 39 def file_create_folder_with_http_info(app_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FileApi.file_create_folder ...' end # verify the required parameter 'app_key' is set if @api_client.config.client_side_validation && app_key.nil? fail ArgumentError, "Missing the required parameter 'app_key' when calling FileApi.file_create_folder" end # resource path local_var_path = '/File/{appKey}/CreateFolder'.sub('{' + 'appKey' + '}', CGI.escape(app_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BooleanApiResponse' # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] = opts.merge( :operation => :"FileApi.file_create_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#file_delete(app_key, opts = {}) ⇒ BooleanApiResponse
删除文件 / 文件夹根据指定路径删除文件或文件夹
94 95 96 97 |
# File 'lib/zsgf_client/api/file_api.rb', line 94 def file_delete(app_key, opts = {}) data, _status_code, _headers = file_delete_with_http_info(app_key, opts) data end |
#file_delete_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
删除文件 / 文件夹根据指定路径删除文件或文件夹
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/zsgf_client/api/file_api.rb', line 105 def file_delete_with_http_info(app_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FileApi.file_delete ...' end # verify the required parameter 'app_key' is set if @api_client.config.client_side_validation && app_key.nil? fail ArgumentError, "Missing the required parameter 'app_key' when calling FileApi.file_delete" end # resource path local_var_path = '/File/{appKey}'.sub('{' + 'appKey' + '}', CGI.escape(app_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BooleanApiResponse' # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] = opts.merge( :operation => :"FileApi.file_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#file_rename(app_key, opts = {}) ⇒ BooleanApiResponse
重命名文件 / 文件夹将指定的文件或文件夹重命名
161 162 163 164 |
# File 'lib/zsgf_client/api/file_api.rb', line 161 def file_rename(app_key, opts = {}) data, _status_code, _headers = file_rename_with_http_info(app_key, opts) data end |
#file_rename_with_http_info(app_key, opts = {}) ⇒ Array<(BooleanApiResponse, Integer, Hash)>
重命名文件 / 文件夹将指定的文件或文件夹重命名
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/zsgf_client/api/file_api.rb', line 173 def file_rename_with_http_info(app_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FileApi.file_rename ...' end # verify the required parameter 'app_key' is set if @api_client.config.client_side_validation && app_key.nil? fail ArgumentError, "Missing the required parameter 'app_key' when calling FileApi.file_rename" end # resource path local_var_path = '/File/{appKey}/Rename'.sub('{' + 'appKey' + '}', CGI.escape(app_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'sourceName'] = opts[:'source_name'] if !opts[:'source_name'].nil? query_params[:'destName'] = opts[:'dest_name'] if !opts[:'dest_name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BooleanApiResponse' # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] = opts.merge( :operation => :"FileApi.file_rename", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_rename\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#file_upload(app_key, opts = {}) ⇒ StringApiResponse
上传文件将文件上传到指定路径
230 231 232 233 |
# File 'lib/zsgf_client/api/file_api.rb', line 230 def file_upload(app_key, opts = {}) data, _status_code, _headers = file_upload_with_http_info(app_key, opts) data end |
#file_upload_with_http_info(app_key, opts = {}) ⇒ Array<(StringApiResponse, Integer, Hash)>
上传文件将文件上传到指定路径
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/zsgf_client/api/file_api.rb', line 242 def file_upload_with_http_info(app_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FileApi.file_upload ...' end # verify the required parameter 'app_key' is set if @api_client.config.client_side_validation && app_key.nil? fail ArgumentError, "Missing the required parameter 'app_key' when calling FileApi.file_upload" end # resource path local_var_path = '/File/{appKey}/Upload'.sub('{' + 'appKey' + '}', CGI.escape(app_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} form_params['file'] = opts[:'file'] if !opts[:'file'].nil? # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'StringApiResponse' # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] = opts.merge( :operation => :"FileApi.file_upload", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#files(app_key, opts = {}) ⇒ FileListResultApiResponse
获取文件列表根据指定路径获取文件和文件夹列表
305 306 307 308 |
# File 'lib/zsgf_client/api/file_api.rb', line 305 def files(app_key, opts = {}) data, _status_code, _headers = files_with_http_info(app_key, opts) data end |
#files_with_http_info(app_key, opts = {}) ⇒ Array<(FileListResultApiResponse, Integer, Hash)>
获取文件列表根据指定路径获取文件和文件夹列表
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/zsgf_client/api/file_api.rb', line 318 def files_with_http_info(app_key, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FileApi.files ...' end # verify the required parameter 'app_key' is set if @api_client.config.client_side_validation && app_key.nil? fail ArgumentError, "Missing the required parameter 'app_key' when calling FileApi.files" end # resource path local_var_path = '/File/{appKey}'.sub('{' + 'appKey' + '}', CGI.escape(app_key.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FileListResultApiResponse' # auth_names auth_names = opts[:debug_auth_names] || ['Bearer'] = opts.merge( :operation => :"FileApi.files", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |