Class: AsposeDiagramCloud::StorageApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grant_type, app_sid, app_key, api_client = ApiClient.default) ⇒ StorageApi

Returns a new instance of StorageApi.



19
20
21
22
23
24
25
26
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 19

def initialize(grant_type,app_sid,app_key,api_client = ApiClient.default)
  @api_client = api_client
  @api_client.config.api_key['api_key'] = app_key
  @api_client.config.api_key['app_sid'] = app_sid
  @api_client.config.api_key['grant_type'] = grant_type
  request_token

end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#copy_file(src_path, dest_path, opts = {}) ⇒ nil

Copy file

Parameters:

  • src_path

    Source file path e.g. '/folder/file.ext'

  • dest_path

    Destination file path

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

  • :version_id (String)

    File version ID to copy

Returns:

  • (nil)


52
53
54
55
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 52

def copy_file(src_path, dest_path, opts = {})
  copy_file_with_http_info(src_path, dest_path, opts)
  return nil
end

#copy_file_with_http_info(src_path, dest_path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Copy file

Parameters:

  • src_path

    Source file path e.g. &#39;/folder/file.ext&#39;

  • dest_path

    Destination file path

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

  • :version_id (String)

    File version ID to copy

Returns:

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

    nil, response status code and response headers



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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 66

def copy_file_with_http_info(src_path, dest_path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.copy_file ..."
  end
  # verify the required parameter 'src_path' is set
  if @api_client.config.client_side_validation && src_path.nil?
    fail ArgumentError, "Missing the required parameter 'src_path' when calling StorageApi.copy_file"
  end
  # verify the required parameter 'dest_path' is set
  if @api_client.config.client_side_validation && dest_path.nil?
    fail ArgumentError, "Missing the required parameter 'dest_path' when calling StorageApi.copy_file"
  end
  # resource path
  local_var_path = "/diagram/storage/file/copy/{srcPath}".sub('{' + 'srcPath' + '}', src_path.to_s)

  # query parameters
  query_params = {}
  query_params[:'destPath'] = dest_path
  query_params[:'srcStorageName'] = opts[:'src_storage_name'] if !opts[:'src_storage_name'].nil?
  query_params[:'destStorageName'] = opts[:'dest_storage_name'] if !opts[:'dest_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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#copy_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#copy_folder(src_path, dest_path, opts = {}) ⇒ nil

Copy folder

Parameters:

  • src_path

    Source folder path e.g. &#39;/src&#39;

  • dest_path

    Destination folder path e.g. &#39;/dst&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

Returns:

  • (nil)


121
122
123
124
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 121

def copy_folder(src_path, dest_path, opts = {})
  copy_folder_with_http_info(src_path, dest_path, opts)
  return nil
end

#copy_folder_with_http_info(src_path, dest_path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Copy folder

Parameters:

  • src_path

    Source folder path e.g. &#39;/src&#39;

  • dest_path

    Destination folder path e.g. &#39;/dst&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

Returns:

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

    nil, response status code and response headers



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 134

def copy_folder_with_http_info(src_path, dest_path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.copy_folder ..."
  end
  # verify the required parameter 'src_path' is set
  if @api_client.config.client_side_validation && src_path.nil?
    fail ArgumentError, "Missing the required parameter 'src_path' when calling StorageApi.copy_folder"
  end
  # verify the required parameter 'dest_path' is set
  if @api_client.config.client_side_validation && dest_path.nil?
    fail ArgumentError, "Missing the required parameter 'dest_path' when calling StorageApi.copy_folder"
  end
  # resource path
  local_var_path = "/diagram/storage/folder/copy/{srcPath}".sub('{' + 'srcPath' + '}', src_path.to_s)

  # query parameters
  query_params = {}
  query_params[:'destPath'] = dest_path
  query_params[:'srcStorageName'] = opts[:'src_storage_name'] if !opts[:'src_storage_name'].nil?
  query_params[:'destStorageName'] = opts[:'dest_storage_name'] if !opts[:'dest_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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#copy_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_folder(path, opts = {}) ⇒ nil

Create the folder

Parameters:

  • path

    Folder path to create e.g. &#39;folder_1/folder_2/&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

  • (nil)


186
187
188
189
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 186

def create_folder(path, opts = {})
  create_folder_with_http_info(path, opts)
  return nil
end

#create_folder_with_http_info(path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create the folder

Parameters:

  • path

    Folder path to create e.g. &#39;folder_1/folder_2/&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

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

    nil, response status code and response headers



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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 197

def create_folder_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # 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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @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

Parameters:

  • path

    File path e.g. &#39;/folder/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID to delete

Returns:

  • (nil)


244
245
246
247
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 244

def delete_file(path, opts = {})
  delete_file_with_http_info(path, opts)
  return nil
end

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

Delete file

Parameters:

  • path

    File path e.g. &#39;/folder/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID to delete

Returns:

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

    nil, response status code and response headers



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

def delete_file_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/file/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @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

Parameters:

  • path

    Folder path e.g. &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :recursive (BOOLEAN)

    Enable to delete folders, subfolders and files (default to false)

Returns:

  • (nil)


304
305
306
307
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 304

def delete_folder(path, opts = {})
  delete_folder_with_http_info(path, opts)
  return nil
end

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

Delete folder

Parameters:

  • path

    Folder path e.g. &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :recursive (BOOLEAN)

    Enable to delete folders, subfolders and files

Returns:

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

    nil, response status code and response headers



316
317
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
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 316

def delete_folder_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @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

Parameters:

  • path

    File path e.g. &#39;/folder/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID to download

Returns:

  • (File)


364
365
366
367
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 364

def download_file(path, opts = {})
  data, _status_code, _headers = download_file_with_http_info(path, opts)
  return data
end

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

Download file

Parameters:

  • path

    File path e.g. &#39;/folder/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID to download

Returns:

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

    File data, response status code and response headers



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 376

def download_file_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/file/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  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(['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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'File')
  if @api_client.config.debugging
    @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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:



423
424
425
426
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 423

def get_disc_usage(opts = {})
  data, _status_code, _headers = get_disc_usage_with_http_info(opts)
  return data
end

#get_disc_usage_with_http_info(opts = {}) ⇒ Array<(DiscUsage, Fixnum, Hash)>

Get disc usage

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

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

    DiscUsage data, response status code and response headers



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
459
460
461
462
463
464
465
466
467
468
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 433

def get_disc_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.get_disc_usage ..."
  end
  # resource path
  local_var_path = "/diagram/storage/disc"

  # 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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'DiscUsage')
  if @api_client.config.debugging
    @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_file_versions(path, opts = {}) ⇒ FileVersions

Get file versions

Parameters:

  • path

    File path e.g. &#39;/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:



476
477
478
479
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 476

def get_file_versions(path, opts = {})
  data, _status_code, _headers = get_file_versions_with_http_info(path, opts)
  return data
end

#get_file_versions_with_http_info(path, opts = {}) ⇒ Array<(FileVersions, Fixnum, Hash)>

Get file versions

Parameters:

  • path

    File path e.g. &#39;/file.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

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

    FileVersions data, response status code and response headers



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
526
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 487

def get_file_versions_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.get_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_file_versions"
  end
  # resource path
  local_var_path = "/diagram/storage/version/{path}".sub('{' + 'path' + '}', path.to_s)

  # 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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'FileVersions')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#get_file_versions\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

Parameters:

  • path

    Folder path e.g. &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:



534
535
536
537
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 534

def get_files_list(path, opts = {})
  data, _status_code, _headers = get_files_list_with_http_info(path, opts)
  return data
end

#get_files_list_with_http_info(path, opts = {}) ⇒ Array<(FilesList, Fixnum, Hash)>

Get all files and folders within a folder

Parameters:

  • path

    Folder path e.g. &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

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

    FilesList data, response status code and response headers



545
546
547
548
549
550
551
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
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 545

def get_files_list_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/folder/{path}".sub('{' + 'path' + '}', path.to_s)

  # 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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'FilesList')
  if @api_client.config.debugging
    @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

#move_file(src_path, dest_path, opts = {}) ⇒ nil

Move file

Parameters:

  • src_path

    Source file path e.g. &#39;/src.ext&#39;

  • dest_path

    Destination file path e.g. &#39;/dest.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

  • :version_id (String)

    File version ID to move

Returns:

  • (nil)


595
596
597
598
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 595

def move_file(src_path, dest_path, opts = {})
  move_file_with_http_info(src_path, dest_path, opts)
  return nil
end

#move_file_with_http_info(src_path, dest_path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Move file

Parameters:

  • src_path

    Source file path e.g. &#39;/src.ext&#39;

  • dest_path

    Destination file path e.g. &#39;/dest.ext&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

  • :version_id (String)

    File version ID to move

Returns:

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

    nil, response status code and response headers



609
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
645
646
647
648
649
650
651
652
653
654
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 609

def move_file_with_http_info(src_path, dest_path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.move_file ..."
  end
  # verify the required parameter 'src_path' is set
  if @api_client.config.client_side_validation && src_path.nil?
    fail ArgumentError, "Missing the required parameter 'src_path' when calling StorageApi.move_file"
  end
  # verify the required parameter 'dest_path' is set
  if @api_client.config.client_side_validation && dest_path.nil?
    fail ArgumentError, "Missing the required parameter 'dest_path' when calling StorageApi.move_file"
  end
  # resource path
  local_var_path = "/diagram/storage/file/move/{srcPath}".sub('{' + 'srcPath' + '}', src_path.to_s)

  # query parameters
  query_params = {}
  query_params[:'destPath'] = dest_path
  query_params[:'srcStorageName'] = opts[:'src_storage_name'] if !opts[:'src_storage_name'].nil?
  query_params[:'destStorageName'] = opts[:'dest_storage_name'] if !opts[:'dest_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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#move_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#move_folder(src_path, dest_path, opts = {}) ⇒ nil

Move folder

Parameters:

  • src_path

    Folder path to move e.g. &#39;/folder&#39;

  • dest_path

    Destination folder path to move to e.g &#39;/dst&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

Returns:

  • (nil)


664
665
666
667
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 664

def move_folder(src_path, dest_path, opts = {})
  move_folder_with_http_info(src_path, dest_path, opts)
  return nil
end

#move_folder_with_http_info(src_path, dest_path, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Move folder

Parameters:

  • src_path

    Folder path to move e.g. &#39;/folder&#39;

  • dest_path

    Destination folder path to move to e.g &#39;/dst&#39;

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

    the optional parameters

Options Hash (opts):

  • :src_storage_name (String)

    Source storage name

  • :dest_storage_name (String)

    Destination storage name

Returns:

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

    nil, response status code and response headers



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
712
713
714
715
716
717
718
719
720
721
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 677

def move_folder_with_http_info(src_path, dest_path, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: StorageApi.move_folder ..."
  end
  # verify the required parameter 'src_path' is set
  if @api_client.config.client_side_validation && src_path.nil?
    fail ArgumentError, "Missing the required parameter 'src_path' when calling StorageApi.move_folder"
  end
  # verify the required parameter 'dest_path' is set
  if @api_client.config.client_side_validation && dest_path.nil?
    fail ArgumentError, "Missing the required parameter 'dest_path' when calling StorageApi.move_folder"
  end
  # resource path
  local_var_path = "/diagram/storage/folder/move/{srcPath}".sub('{' + 'srcPath' + '}', src_path.to_s)

  # query parameters
  query_params = {}
  query_params[:'destPath'] = dest_path
  query_params[:'srcStorageName'] = opts[:'src_storage_name'] if !opts[:'src_storage_name'].nil?
  query_params[:'destStorageName'] = opts[:'dest_storage_name'] if !opts[:'dest_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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#move_folder\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

Parameters:

  • path

    File or folder path e.g. &#39;/file.ext&#39; or &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID

Returns:



730
731
732
733
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 730

def object_exists(path, opts = {})
  data, _status_code, _headers = object_exists_with_http_info(path, opts)
  return data
end

#object_exists_with_http_info(path, opts = {}) ⇒ Array<(ObjectExist, Fixnum, Hash)>

Check if file or folder exists

Parameters:

  • path

    File or folder path e.g. &#39;/file.ext&#39; or &#39;/folder&#39;

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

  • :version_id (String)

    File version ID

Returns:

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

    ObjectExist data, response status code and response headers



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
772
773
774
775
776
777
778
779
780
781
782
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 742

def object_exists_with_http_info(path, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/exist/{path}".sub('{' + 'path' + '}', path.to_s)

  # query parameters
  query_params = {}
  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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'ObjectExist')
  if @api_client.config.debugging
    @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

#request_tokenObject

Gets a request token from server



31
32
33
34
35
36
37
38
39
40
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 31

def request_token
  authconfig=Configuration.new
  authconfig.base_path=""
  authClient=ApiClient.new(authconfig)
  authApi=AsposeDiagramCloud::OAuthApi.new(authClient)
  config=@api_client.config
  data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])
  #print(data.access_token)
  @api_client.default_headers["Authorization"] ="Bearer " + data.access_token
end

#storage_exists(storage_name, opts = {}) ⇒ StorageExist

Check if storage exists

Parameters:

  • storage_name

    Storage name

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

    the optional parameters

Returns:



789
790
791
792
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 789

def storage_exists(storage_name, opts = {})
  data, _status_code, _headers = storage_exists_with_http_info(storage_name, opts)
  return data
end

#storage_exists_with_http_info(storage_name, opts = {}) ⇒ Array<(StorageExist, Fixnum, Hash)>

Check if storage exists

Parameters:

  • storage_name

    Storage name

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

    the optional parameters

Returns:

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

    StorageExist data, response status code and response headers



799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 799

def storage_exists_with_http_info(storage_name, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/{storageName}/exist".sub('{' + 'storageName' + '}', storage_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
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'StorageExist')
  if @api_client.config.debugging
    @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

Parameters:

  • path

    Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header.

  • file

    File to upload

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:



846
847
848
849
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 846

def upload_file(path, file, opts = {})
  data, _status_code, _headers = upload_file_with_http_info(path, file, opts)
  return data
end

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

Upload file

Parameters:

  • path

    Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header.

  • file

    File to upload

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

    the optional parameters

Options Hash (opts):

  • :storage_name (String)

    Storage name

Returns:

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

    FilesUploadResult data, response status code and response headers



858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/AsposeDiagramCloud/api/storage_api.rb', line 858

def upload_file_with_http_info(path, file, opts = {})
  if @api_client.config.debugging
    @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 = "/diagram/storage/file/{path}".sub('{' + 'path' + '}', path.to_s)

  # 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(['multipart/form-data'])
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])

  # form parameters
  form_params = {}
  #form_params["File"] = file

  # http body (model)
  post_body = file
  auth_names = ['JWT']
  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,
    :auth_names => auth_names,
    :return_type => 'FilesUploadResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StorageApi#upload_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end