Class: AsposeHtml::StorageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_html/api/storage_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ StorageApi

Returns a new instance of StorageApi.



35
36
37
# File 'lib/aspose_html/api/storage_api.rb', line 35

def initialize(args)
  @api_client = AsposeHtml::ApiClient.default(args)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



33
34
35
# File 'lib/aspose_html/api/storage_api.rb', line 33

def api_client
  @api_client
end

Instance Method Details

#delete_file(path, opts = {}) ⇒ RemoveFileResponse

Remove a specific file

Parameters:

  • path

    Path of the file including file name and extension e.g. /Folder1/file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File's version

  • :storage (String)

    User's storage name

Returns:



276
277
278
279
# File 'lib/aspose_html/api/storage_api.rb', line 276

def delete_file(path, opts = {})
  data, _status_code, _headers = delete_file_with_http_info(path, opts)
  data
end

#delete_file_with_http_info(path, opts = {}) ⇒ Array<(RemoveFileResponse, Fixnum, Hash)>

Remove a specific file

Parameters:

  • path

    Path of the file including file name and extension e.g. /Folder1/file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(RemoveFileResponse, Fixnum, Hash)>)

    RemoveFileResponse data, response status code and response headers



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
321
322
323
324
325
326
327
# File 'lib/aspose_html/api/storage_api.rb', line 288

def delete_file_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FileApi.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 FileApi.delete_file"
  end
  # resource path
  local_var_path = "/storage/file"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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,
                                                    :return_type => 'RemoveFileResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FileApi#delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_folder(path, opts = {}) ⇒ RemoveFolderResponse

Remove a specific folder

Parameters:

  • path

    Folder path e.g. /Folder1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

  • :recursive (BOOLEAN)

    Remove recursivelly inner folder/files. If false and folder contains data than exception is raised. (default to false)

Returns:



540
541
542
543
# File 'lib/aspose_html/api/storage_api.rb', line 540

def delete_folder(path, opts = {})
  data, _status_code, _headers = delete_folder_with_http_info(path, opts)
  data
end

#delete_folder_with_http_info(path, opts = {}) ⇒ Array<(RemoveFolderResponse, Fixnum, Hash)>

Remove a specific folder

Parameters:

  • path

    Folder path e.g. /Folder1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

  • :recursive (BOOLEAN)

    Remove recursivelly inner folder/files. If false and folder contains data than exception is raised.

Returns:

  • (Array<(RemoveFolderResponse, Fixnum, Hash)>)

    RemoveFolderResponse data, response status code and response headers



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/aspose_html/api/storage_api.rb', line 552

def delete_folder_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FolderApi.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 FolderApi.delete_folder"
  end
  # resource path
  local_var_path = "/storage/folder"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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,
                                                    :return_type => 'RemoveFolderResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FolderApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_disc_usage(opts = {}) ⇒ DiscUsageResponse

Check the disk usage of the current account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

Returns:



50
51
52
53
# File 'lib/aspose_html/api/storage_api.rb', line 50

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<(DiscUsageResponse, Fixnum, Hash)>

Check the disk usage of the current account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(DiscUsageResponse, Fixnum, Hash)>)

    DiscUsageResponse data, response status code and response headers



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
90
91
92
93
# File 'lib/aspose_html/api/storage_api.rb', line 60

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 = "/storage/disc"

  # query parameters
  query_params = {}
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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 => 'DiscUsageResponse')
  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_download(path, opts = {}) ⇒ File

Download a specific file

Parameters:

  • path

    Path of the file including the file name and extension e.g. /file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:

  • (File)


336
337
338
339
340
# File 'lib/aspose_html/api/storage_api.rb', line 336

def get_download(path, opts = {})
  data, _status_code, _headers = get_download_with_http_info(path, opts)
  status = _status_code == 200 ? "OK" : "Error"
  {file: data, code: _status_code, status: status}
end

#get_download_with_http_info(path, opts = {}) ⇒ Array<(File, Fixnum, Hash)>

Download a specific file

Parameters:

  • path

    Path of the file including the file name and extension e.g. /file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(File, Fixnum, Hash)>)

    File data, response status code and response headers



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
388
# File 'lib/aspose_html/api/storage_api.rb', line 349

def get_download_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FileApi.get_download ..."
  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 FileApi.get_download"
  end
  # resource path
  local_var_path = "/storage/file"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
  # 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 => 'File')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FileApi#get_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_is_exist(path, opts = {}) ⇒ FileExistResponse

Check if a specific file or folder exists

Parameters:

  • path

    File or folder path e.g. /file.ext or /Folder1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:



102
103
104
105
# File 'lib/aspose_html/api/storage_api.rb', line 102

def get_is_exist(path, opts = {})
  data, _status_code, _headers = get_is_exist_with_http_info(path, opts)
  data
end

#get_is_exist_with_http_info(path, opts = {}) ⇒ Array<(FileExistResponse, Fixnum, Hash)>

Check if a specific file or folder exists

Parameters:

  • path

    File or folder path e.g. /file.ext or /Folder1

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    File&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(FileExistResponse, Fixnum, Hash)>)

    FileExistResponse data, response status code and response headers



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
153
# File 'lib/aspose_html/api/storage_api.rb', line 114

def get_is_exist_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: StorageApi.get_is_exist ..."
  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_is_exist"
  end
  # resource path
  local_var_path = "/storage/exist"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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 => 'FileExistResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: StorageApi#get_is_exist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_is_storage_exist(name) ⇒ StorageExistResponse

Check if storage exists

Parameters:

  • name

    Storage name

Returns:



159
160
161
162
# File 'lib/aspose_html/api/storage_api.rb', line 159

def get_is_storage_exist(name)
  data, _status_code, _headers = get_is_storage_exist_with_http_info(name)
  data
end

#get_is_storage_exist_with_http_info(name) ⇒ Array<(StorageExistResponse, Fixnum, Hash)>

Check if storage exists

Parameters:

  • name

    Storage name

Returns:

  • (Array<(StorageExistResponse, Fixnum, Hash)>)

    StorageExistResponse data, response status code and response headers



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
201
202
203
204
# File 'lib/aspose_html/api/storage_api.rb', line 168

def get_is_storage_exist_with_http_info(name)
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: StorageApi.get_is_storage_exist ..."
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StorageApi.get_is_storage_exist"
  end
  # resource path
  local_var_path = "/storage/{name}/exist".sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}

  # 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 => 'StorageExistResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: StorageApi#get_is_storage_exist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list_file_versions(path, opts = {}) ⇒ FileVersionsResponse

Get the file’s versions list

Parameters:

  • path

    File path e.g. /file.ext or /Folder1/file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

Returns:



212
213
214
215
# File 'lib/aspose_html/api/storage_api.rb', line 212

def get_list_file_versions(path, opts = {})
  data, _status_code, _headers = get_list_file_versions_with_http_info(path, opts)
  data
end

#get_list_file_versions_with_http_info(path, opts = {}) ⇒ Array<(FileVersionsResponse, Fixnum, Hash)>

Get the file&#39;s versions list

Parameters:

  • path

    File path e.g. /file.ext or /Folder1/file.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(FileVersionsResponse, Fixnum, Hash)>)

    FileVersionsResponse data, response status code and response headers



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/api/storage_api.rb', line 223

def get_list_file_versions_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: StorageApi.get_list_file_versions ..."
  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_list_file_versions"
  end
  # resource path
  local_var_path = "/storage/version"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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 => 'FileVersionsResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: StorageApi#get_list_file_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_list_files(opts = {}) ⇒ FileDetailsResponse

Get the file listing of a specific folder

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :path (String)

    Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39; (default to /)

  • :storage (String)

    User&#39;s storage name

Returns:



599
600
601
602
# File 'lib/aspose_html/api/storage_api.rb', line 599

def get_list_files(opts = {})
  data, _status_code, _headers = get_list_files_with_http_info(opts)
  data
end

#get_list_files_with_http_info(opts = {}) ⇒ Array<(FileDetailsResponse, Fixnum, Hash)>

Get the file listing of a specific folder

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :path (String)

    Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39;

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(FileDetailsResponse, Fixnum, Hash)>)

    File data, response status code and response headers



610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/aspose_html/api/storage_api.rb', line 610

def get_list_files_with_http_info(opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FolderApi.get_list_files ..."
  end
  # resource path
  local_var_path = "/storage/folder"

  # query parameters
  query_params = {}
  query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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 => 'FileDetailsResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FolderApi#get_list_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_move_file(src, dest, opts = {}) ⇒ MoveFileResponse

Move a specific file

Parameters:

  • src

    Source file path e.g. /fileSource.ext

  • dest

    Destination file path e.g. /fileDestination.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    Source file&#39;s version,

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:



399
400
401
402
# File 'lib/aspose_html/api/storage_api.rb', line 399

def post_move_file(src, dest, opts = {})
  data, _status_code, _headers = post_move_file_with_http_info(src, dest, opts)
  data
end

#post_move_file_with_http_info(src, dest, opts = {}) ⇒ Array<(MoveFileResponse, Fixnum, Hash)>

Move a specific file

Parameters:

  • src

    Source file path e.g. /fileSource.ext

  • dest

    Destination file path e.g. /fileDestination.ext

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    Source file&#39;s version,

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:

  • (Array<(MoveFileResponse, Fixnum, Hash)>)

    MoveFileResponse data, response status code and response headers



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
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/aspose_html/api/storage_api.rb', line 413

def post_move_file_with_http_info(src, dest, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FileApi.post_move_file ..."
  end
  # verify the required parameter 'src' is set
  if @api_client.config.client_side_validation && src.nil?
    fail ArgumentError, "Missing the required parameter 'src' when calling FileApi.post_move_file"
  end
  # verify the required parameter 'dest' is set
  if @api_client.config.client_side_validation && dest.nil?
    fail ArgumentError, "Missing the required parameter 'dest' when calling FileApi.post_move_file"
  end
  # resource path
  local_var_path = "/storage/file"

  # query parameters
  query_params = {}
  query_params[:'src'] = src
  query_params[:'dest'] = dest
  query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].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 = {}

  # 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 => 'MoveFileResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FileApi#post_move_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_move_folder(src, dest, opts = {}) ⇒ MoveFolderResponse

Move a specific folder

Parameters:

  • src

    Source folder path e.g. /Folder1

  • dest

    Destination folder path e.g. /Folder2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:



654
655
656
657
# File 'lib/aspose_html/api/storage_api.rb', line 654

def post_move_folder(src, dest, opts = {})
  data, _status_code, _headers = post_move_folder_with_http_info(src, dest, opts)
  data
end

#post_move_folder_with_http_info(src, dest, opts = {}) ⇒ Array<(MoveFolderResponse, Fixnum, Hash)>

Move a specific folder

Parameters:

  • src

    Source folder path e.g. /Folder1

  • dest

    Destination folder path e.g. /Folder2

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:

  • (Array<(MoveFolderResponse, Fixnum, Hash)>)

    MoveFolderResponse data, response status code and response headers



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
# File 'lib/aspose_html/api/storage_api.rb', line 667

def post_move_folder_with_http_info(src, dest, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FolderApi.post_move_folder ..."
  end
  # verify the required parameter 'src' is set
  if @api_client.config.client_side_validation && src.nil?
    fail ArgumentError, "Missing the required parameter 'src' when calling FolderApi.post_move_folder"
  end
  # verify the required parameter 'dest' is set
  if @api_client.config.client_side_validation && dest.nil?
    fail ArgumentError, "Missing the required parameter 'dest' when calling FolderApi.post_move_folder"
  end
  # resource path
  local_var_path = "/storage/folder"

  # query parameters
  query_params = {}
  query_params[:'src'] = src
  query_params[:'dest'] = dest
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].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,
                                                    :return_type => 'MoveFolderResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FolderApi#post_move_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_create(path, file, opts = {}) ⇒ MessageResponse

Upload a specific file

Parameters:

  • path

    Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext

  • file

    File to upload

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    Source file&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:



468
469
470
471
# File 'lib/aspose_html/api/storage_api.rb', line 468

def put_create(path, file, opts = {})
  data, _status_code, _headers = put_create_with_http_info(path, file, opts)
  data
end

#put_create_folder(path, opts = {}) ⇒ MessageResponse

Create the folder

Parameters:

  • path (String)

    Target folder path e.g. Folder1/Folder2/. The folders will be created recursively

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:



720
721
722
723
# File 'lib/aspose_html/api/storage_api.rb', line 720

def put_create_folder(path, opts = {})
  data, _status_code, _headers = put_create_folder_with_http_info(path, opts)
  data
end

#put_create_folder_with_http_info(path, opts = {}) ⇒ Array<(MessageResponse, Fixnum, Hash)>

Create the folder

Parameters:

  • path

    Target folder&#39;s path e.g. Folder1/Folder2/. The folders will be created recursively

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :storage (String)

    User&#39;s source storage name

  • :dest_storage (String)

    User&#39;s destination storage name

Returns:

  • (Array<(MessageResponse, Fixnum, Hash)>)

    MessageResponse, response status code and response headers



732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
# File 'lib/aspose_html/api/storage_api.rb', line 732

def put_create_folder_with_http_info(path, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FolderApi.put_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 FolderApi.put_create_folder"
  end
  # resource path
  local_var_path = "/storage/folder"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
  query_params[:'destStorage'] = opts[:'dest_storage'] if !opts[:'dest_storage'].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(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'MessageResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FolderApi#put_create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_create_with_http_info(path, file, opts = {}) ⇒ Array<(MessageResponse, Fixnum, Hash)>

Upload a specific file

Parameters:

  • path

    Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext

  • file

    File to upload

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :version_id (String)

    Source file&#39;s version

  • :storage (String)

    User&#39;s storage name

Returns:

  • (Array<(MessageResponse, Fixnum, Hash)>)

    MessageResponse, response status code and response headers



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/aspose_html/api/storage_api.rb', line 481

def put_create_with_http_info(path, file, opts = {})
  if @api_client.config.debug
    @api_client.config.logger.debug "Calling API: FileApi.put_create ..."
  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 FileApi.put_create"
  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 FileApi.put_create"
  end
  # resource path
  local_var_path = "/storage/file"

  # query parameters
  query_params = {}
  query_params[:'path'] = path
  query_params[:'versionId'] = opts[:'version_id'] if !opts[:'version_id'].nil?
  query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].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 = ::File.open(file,"rb").read

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
                                                    :header_params => header_params,
                                                    :query_params => query_params,
                                                    :form_params => form_params,
                                                    :body => post_body,
                                                    :return_type => 'MessageResponse')
  if @api_client.config.debug
    @api_client.config.logger.debug "API called: FileApi#put_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end