class AsposeDiagramCloud::StorageApi
Attributes
Public Class Methods
# 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
Public Instance Methods
Copy file
@param src_path Source file path e.g. '/folder/file.ext' @param dest_path Destination file path @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @option opts [String] :version_id File version ID to copy @return [nil]
# 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
@param src_path Source file path e.g. '/folder/file.ext' @param dest_path Destination file path @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @option opts [String] :version_id File version ID to copy @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param src_path Source folder path e.g. '/src' @param dest_path Destination folder path e.g. '/dst' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @return [nil]
# 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
@param src_path Source folder path e.g. '/src' @param dest_path Destination folder path e.g. '/dst' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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 the folder
@param path Folder path to create e.g. 'folder_1/folder_2/' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [nil]
# 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 the folder
@param path Folder path to create e.g. 'folder_1/folder_2/' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param path File path e.g. '/folder/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID to delete @return [nil]
# 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
@param path File path e.g. '/folder/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID to delete @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param path Folder path e.g. '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [BOOLEAN] :recursive Enable to delete folders, subfolders and files (default to false) @return [nil]
# 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
@param path Folder path e.g. '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [BOOLEAN] :recursive Enable to delete folders, subfolders and files @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param path File path e.g. '/folder/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID to download @return [File]
# 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
@param path File path e.g. '/folder/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID to download @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
# 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
@param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [DiscUsage]
# 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
@param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [Array<(DiscUsage
, Fixnum, Hash)>] DiscUsage
data, response status code and response headers
# 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
@param path File path e.g. '/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [FileVersions]
# 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
@param path File path e.g. '/file.ext' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [Array<(FileVersions
, Fixnum, Hash)>] FileVersions
data, response status code and response headers
# 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 all files and folders within a folder
@param path Folder path e.g. '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [FilesList]
# 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 all files and folders within a folder
@param path Folder path e.g. '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [Array<(FilesList
, Fixnum, Hash)>] FilesList
data, response status code and response headers
# 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
@param src_path Source file path e.g. '/src.ext' @param dest_path Destination file path e.g. '/dest.ext' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @option opts [String] :version_id File version ID to move @return [nil]
# 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
@param src_path Source file path e.g. '/src.ext' @param dest_path Destination file path e.g. '/dest.ext' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @option opts [String] :version_id File version ID to move @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
@param src_path Folder path to move e.g. '/folder' @param dest_path Destination folder path to move to e.g '/dst' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @return [nil]
# 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
@param src_path Folder path to move e.g. '/folder' @param dest_path Destination folder path to move to e.g '/dst' @param [Hash] opts the optional parameters @option opts [String] :src_storage_name Source storage name @option opts [String] :dest_storage_name Destination storage name @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# 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
Check if file or folder exists
@param path File or folder path e.g. '/file.ext' or '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID @return [ObjectExist]
# 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
Check if file or folder exists
@param path File or folder path e.g. '/file.ext' or '/folder' @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @option opts [String] :version_id File version ID @return [Array<(ObjectExist
, Fixnum, Hash)>] ObjectExist
data, response status code and response headers
# 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
Gets a request token from server
# 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
Check if storage exists
@param storage_name Storage name @param [Hash] opts the optional parameters @return [StorageExist]
# 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
Check if storage exists
@param storage_name Storage name @param [Hash] opts the optional parameters @return [Array<(StorageExist
, Fixnum, Hash)>] StorageExist
data, response status code and response headers
# 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
@param 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.
@param file File to upload @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [FilesUploadResult]
# 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
@param 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.
@param file File to upload @param [Hash] opts the optional parameters @option opts [String] :storage_name Storage name @return [Array<(FilesUploadResult
, Fixnum, Hash)>] FilesUploadResult
data, response status code and response headers
# 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