class AsposeHtml::StorageApi

Attributes

api_client[RW]

Public Class Methods

new(args) click to toggle source
# File lib/aspose_html/api/storage_api.rb, line 34
def initialize(args)
  @api_client = AsposeHtml::ApiClient.default(args)
end

Public Instance Methods

delete_file(path, opts = {}) click to toggle source

Remove a specific file

@param path Path of the file including file name and extension e.g. /Folder1/file.ext @param [Hash] opts the optional parameters @option opts [String] :version_id File's version @option opts [String] :storage User's storage name @return [RemoveFileResponse]

# File lib/aspose_html/api/storage_api.rb, line 275
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 = {}) click to toggle source

Remove a specific file

@param path Path of the file including file name and extension e.g. /Folder1/file.ext @param [Hash] opts the optional parameters @option opts [String] :version_id File&#39;s version @option opts [String] :storage User&#39;s storage name @return [Array<(RemoveFileResponse, Fixnum, Hash)>] RemoveFileResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 287
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 = {}) click to toggle source

Remove a specific folder

@param path Folder path e.g. /Folder1 @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @option opts [BOOLEAN] :recursive Remove recursivelly inner folder/files. If false and folder contains data than exception is raised. (default to false) @return [RemoveFolderResponse]

# File lib/aspose_html/api/storage_api.rb, line 539
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 = {}) click to toggle source

Remove a specific folder

@param path Folder path e.g. /Folder1 @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @option opts [BOOLEAN] :recursive Remove recursivelly inner folder/files. If false and folder contains data than exception is raised. @return [Array<(RemoveFolderResponse, Fixnum, Hash)>] RemoveFolderResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 551
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 = {}) click to toggle source

Check the disk usage of the current account

@param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @return [DiscUsageResponse]

# File lib/aspose_html/api/storage_api.rb, line 49
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 = {}) click to toggle source

Check the disk usage of the current account

@param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @return [Array<(DiscUsageResponse, Fixnum, Hash)>] DiscUsageResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 59
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 = {}) click to toggle source

Download a specific file

@param path Path of the file including the file name and extension e.g. /file.ext @param [Hash] opts the optional parameters @option opts [String] :version_id File&#39;s version @option opts [String] :storage User&#39;s storage name @return [File]

# File lib/aspose_html/api/storage_api.rb, line 335
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 = {}) click to toggle source

Download a specific file

@param path Path of the file including the file name and extension e.g. /file.ext @param [Hash] opts the optional parameters @option opts [String] :version_id File&#39;s version @option opts [String] :storage User&#39;s storage name @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 348
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 = {}) click to toggle source

Check if a specific file or folder exists

@param path File or folder path e.g. /file.ext or /Folder1 @param [Hash] opts the optional parameters @option opts [String] :version_id File&#39;s version @option opts [String] :storage User&#39;s storage name @return [FileExistResponse]

# File lib/aspose_html/api/storage_api.rb, line 101
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 = {}) click to toggle source

Check if a specific file or folder exists

@param path File or folder path e.g. /file.ext or /Folder1 @param [Hash] opts the optional parameters @option opts [String] :version_id File&#39;s version @option opts [String] :storage User&#39;s storage name @return [Array<(FileExistResponse, Fixnum, Hash)>] FileExistResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 113
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) click to toggle source

Check if storage exists

@param name Storage name @return [StorageExistResponse]

# File lib/aspose_html/api/storage_api.rb, line 158
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) click to toggle source

Check if storage exists

@param name Storage name @return [Array<(StorageExistResponse, Fixnum, Hash)>] StorageExistResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 167
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 = {}) click to toggle source

Get the file's versions list

@param path File path e.g. /file.ext or /Folder1/file.ext @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @return [FileVersionsResponse]

# File lib/aspose_html/api/storage_api.rb, line 211
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 = {}) click to toggle source

Get the file&#39;s versions list

@param path File path e.g. /file.ext or /Folder1/file.ext @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s storage name @return [Array<(FileVersionsResponse, Fixnum, Hash)>] FileVersionsResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 222
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 = {}) click to toggle source

Get the file listing of a specific folder

@param [Hash] opts the optional parameters @option opts [String] :path Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39; (default to /) @option opts [String] :storage User&#39;s storage name @return [FileDetailsResponse]

# File lib/aspose_html/api/storage_api.rb, line 598
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 = {}) click to toggle source

Get the file listing of a specific folder

@param [Hash] opts the optional parameters @option opts [String] :path Start with name of storage e.g. root folder &#39;/&#39;or some folder &#39;/folder1/..&#39; @option opts [String] :storage User&#39;s storage name @return [Array<(FileDetailsResponse, Fixnum, Hash)>] File data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 609
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 = {}) click to toggle source

Move a specific file

@param src Source file path e.g. /fileSource.ext @param dest Destination file path e.g. /fileDestination.ext @param [Hash] opts the optional parameters @option opts [String] :version_id Source file&#39;s version, @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [MoveFileResponse]

# File lib/aspose_html/api/storage_api.rb, line 398
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 = {}) click to toggle source

Move a specific file

@param src Source file path e.g. /fileSource.ext @param dest Destination file path e.g. /fileDestination.ext @param [Hash] opts the optional parameters @option opts [String] :version_id Source file&#39;s version, @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [Array<(MoveFileResponse, Fixnum, Hash)>] MoveFileResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 412
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 = {}) click to toggle source

Move a specific folder

@param src Source folder path e.g. /Folder1 @param dest Destination folder path e.g. /Folder2 @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [MoveFolderResponse]

# File lib/aspose_html/api/storage_api.rb, line 653
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 = {}) click to toggle source

Move a specific folder

@param src Source folder path e.g. /Folder1 @param dest Destination folder path e.g. /Folder2 @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [Array<(MoveFolderResponse, Fixnum, Hash)>] MoveFolderResponse data, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 666
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 = {}) click to toggle source

Upload a specific file

@param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext @param file File to upload @param [Hash] opts the optional parameters @option opts [String] :version_id Source file&#39;s version @option opts [String] :storage User&#39;s storage name @return [MessageResponse]

# File lib/aspose_html/api/storage_api.rb, line 467
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 = {}) click to toggle source

Create the folder

@param path [String] Target folder path e.g. Folder1/Folder2/. The folders will be created recursively @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [MessageResponse]

# File lib/aspose_html/api/storage_api.rb, line 719
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 = {}) click to toggle source

Create the folder

@param path Target folder&#39;s path e.g. Folder1/Folder2/. The folders will be created recursively @param [Hash] opts the optional parameters @option opts [String] :storage User&#39;s source storage name @option opts [String] :dest_storage User&#39;s destination storage name @return [Array<(MessageResponse, Fixnum, Hash)>] MessageResponse, response status code and response headers

# File lib/aspose_html/api/storage_api.rb, line 731
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 = {}) click to toggle source

Upload a specific file

@param path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext @param file File to upload @param [Hash] opts the optional parameters @option opts [String] :version_id Source file&#39;s version @option opts [String] :storage User&#39;s storage name @return [Array<(MessageResponse, Fixnum, Hash)>] MessageResponse, response status code and response headers

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