Class: AsposeHtml::StorageApi
- Inherits:
-
Object
- Object
- AsposeHtml::StorageApi
- Defined in:
- lib/aspose_html_cloud/api/storage_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_folder(path, opts = {}) ⇒ nil
Create the folder.
-
#create_folder_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Create the folder.
-
#delete_file(path, opts = {}) ⇒ nil
Delete file.
-
#delete_file_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete file.
-
#delete_folder(path, opts = {}) ⇒ nil
Delete folder.
-
#delete_folder_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete folder.
-
#download_file(path, opts = {}) ⇒ File
Download file.
-
#download_file_with_http_info(path, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Download file.
-
#get_disc_usage(opts = {}) ⇒ DiscUsage
Get disc usage.
-
#get_disc_usage_with_http_info(opts = {}) ⇒ Array<(DiscUsage, Fixnum, Hash)>
Get disc usage.
-
#get_files_list(path, opts = {}) ⇒ FilesList
Get all files and folders within a folder.
-
#get_files_list_with_http_info(path, opts = {}) ⇒ Array<(FilesList, Fixnum, Hash)>
Get all files and folders within a folder.
-
#initialize(args) ⇒ StorageApi
constructor
A new instance of StorageApi.
-
#object_exists(path, opts = {}) ⇒ ObjectExist
Check if file or folder exists.
-
#object_exists_with_http_info(path, opts = {}) ⇒ Array<(ObjectExist, Fixnum, Hash)>
Check if file or folder exists.
-
#storage_exists(storage_name, opts = {}) ⇒ StorageExist
Check if storage exists.
-
#storage_exists_with_http_info(storage_name, opts = {}) ⇒ Array<(StorageExist, Fixnum, Hash)>
Check if storage exists.
-
#upload_file(path, file, opts = {}) ⇒ FilesUploadResult
Upload file.
-
#upload_file_with_http_info(path, file, opts = {}) ⇒ Array<(FilesUploadResult, Fixnum, Hash)>
Upload file.
Constructor Details
#initialize(args) ⇒ StorageApi
Returns a new instance of StorageApi.
35 36 37 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 35 def initialize(args) @api_client = AsposeHtml::ApiClient.default(args) end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
33 34 35 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 33 def api_client @api_client end |
Instance Method Details
#create_folder(path, opts = {}) ⇒ nil
Create the folder
398 399 400 401 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 398 def create_folder(path, opts = {}) create_folder_with_http_info(path, opts) nil end |
#create_folder_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Create the folder
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 408 def create_folder_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.create_folder ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.create_folder" end # resource path local_var_path = '/html/folder' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body) if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_file(path, opts = {}) ⇒ nil
Delete file
212 213 214 215 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 212 def delete_file(path, opts = {}) delete_file_with_http_info(path, opts) nil end |
#delete_file_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete file
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 223 def delete_file_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.delete_file ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.delete_file" end # resource path local_var_path = '/html/file' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body) if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_folder(path, opts = {}) ⇒ nil
Delete folder
453 454 455 456 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 453 def delete_folder(path, opts = {}) delete_folder_with_http_info(path, opts) nil end |
#delete_folder_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>
Delete folder
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 464 def delete_folder_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.delete_folder ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.delete_folder" end # resource path local_var_path = '/html/folder' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? query_params[:'recursive'] = opts[:'recursive'] if !opts[:'recursive'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body) if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#download_file(path, opts = {}) ⇒ File
Download file
269 270 271 272 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 269 def download_file(path, opts = {}) data, _status_code, _headers = download_file_with_http_info(path, opts) data end |
#download_file_with_http_info(path, opts = {}) ⇒ Array<(File, Fixnum, Hash)>
Download file
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 280 def download_file_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.download_file ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.download_file" end # resource path local_var_path = '/html/file' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type( ['application/octet-stream']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'File') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#download_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_disc_usage(opts = {}) ⇒ DiscUsage
Get disc usage
47 48 49 50 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 47 def get_disc_usage(opts = {}) data, _status_code, _headers = get_disc_usage_with_http_info(opts) data end |
#get_disc_usage_with_http_info(opts = {}) ⇒ Array<(DiscUsage, Fixnum, Hash)>
Get disc usage
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 87 88 89 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 56 def get_disc_usage_with_http_info(opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.get_disc_usage ...' end # resource path local_var_path = '/html/storage/disc/usage' # query parameters query_params = {} query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'DiscUsage') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#get_disc_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_files_list(path, opts = {}) ⇒ FilesList
Get all files and folders within a folder
509 510 511 512 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 509 def get_files_list(path, opts = {}) data, _status_code, _headers = get_files_list_with_http_info(path, opts) data end |
#get_files_list_with_http_info(path, opts = {}) ⇒ Array<(FilesList, Fixnum, Hash)>
Get all files and folders within a folder
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 519 def get_files_list_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.get_files_list ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.get_files_list" end # resource path local_var_path = '/html/folder' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'FilesList') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#get_files_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#object_exists(path, opts = {}) ⇒ ObjectExist
Check if file or folder exists
98 99 100 101 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 98 def object_exists(path, opts = {}) data, _status_code, _headers = object_exists_with_http_info(path, opts) data end |
#object_exists_with_http_info(path, opts = {}) ⇒ Array<(ObjectExist, Fixnum, Hash)>
Check if file or folder exists
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 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 109 def object_exists_with_http_info(path, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.object_exists ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.object_exists" end # resource path local_var_path = '/html/storage/exist' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'ObjectExist') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#object_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#storage_exists(storage_name, opts = {}) ⇒ StorageExist
Check if storage exists
154 155 156 157 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 154 def storage_exists(storage_name, opts = {}) data, _status_code, _headers = storage_exists_with_http_info(storage_name, opts) data end |
#storage_exists_with_http_info(storage_name, opts = {}) ⇒ Array<(StorageExist, Fixnum, Hash)>
Check if storage exists
163 164 165 166 167 168 169 170 171 172 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 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 163 def storage_exists_with_http_info(storage_name, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.storage_exists ...' end # verify the required parameter 'storage_name' is set if @api_client.config.client_side_validation && storage_name.nil? fail ArgumentError, "Missing the required parameter 'storage_name' when calling StorageApi.storage_exists" end # resource path local_var_path = '/html/storage/exist/storage' # query parameters query_params = {} query_params[:'storageName'] = storage_name.to_s # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'StorageExist') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#storage_exists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#upload_file(path, file, opts = {}) ⇒ FilesUploadResult
Upload file
329 330 331 332 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 329 def upload_file(path, file, opts = {}) data, _status_code, _headers = upload_file_with_http_info(path, file, opts) data end |
#upload_file_with_http_info(path, file, opts = {}) ⇒ Array<(FilesUploadResult, Fixnum, Hash)>
Upload file
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 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/aspose_html_cloud/api/storage_api.rb', line 340 def upload_file_with_http_info(path, file, opts = {}) if @api_client.config.debug @api_client.config.logger.debug 'Calling API: StorageApi.upload_file ...' end # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? fail ArgumentError, "Missing the required parameter 'path' when calling StorageApi.upload_file" end # verify the required parameter 'file' is set if @api_client.config.client_side_validation && file.nil? fail ArgumentError, "Missing the required parameter 'file' when calling StorageApi.upload_file" end # resource path local_var_path = '/html/file' # query parameters query_params = {} query_params[:'path'] = path.to_s query_params[:'storageName'] = opts[:'storage_name'] if !opts[:'storage_name'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data']) # form parameters form_params = {} form_params['file'] = File.new(file) # http body (model) post_body = nil data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :return_type => 'FilesUploadResult') if @api_client.config.debug @api_client.config.logger.debug "API called: StorageApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end if status_code != 200 fail ArgumentError, "Unable upload file" end return data, status_code, headers end |