=begin #Web API Swagger specification #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.0-SNAPSHOT =end require "uri" module GroupDocsPlatformCloud class FileApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. # # @param path # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [RemoveFileResponse] def file_delete_file(path, opts = {}) data, _status_code, _headers = file_delete_file_with_http_info(path, opts) return data end # Remove a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. # # @param path # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [Array<(RemoveFileResponse, Fixnum, Hash)>] RemoveFileResponse data, response status code and response headers def file_delete_file_with_http_info(path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FileApi.file_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.file_delete_file" end # resource path local_var_path = "/storage/file/{path}".sub('{' + 'path' + '}', path.to_s) # query parameters query_params = {} 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 auth_names = [] 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, :return_type => 'RemoveFileResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. # # @param path # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [File] def file_get_download(path, opts = {}) data, _status_code, _headers = file_get_download_with_http_info(path, opts) return data end # Download a specific file. Parameters: path - file path e.g. /file.ext, versionID - file's version, storage - user's storage name. # # @param path # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def file_get_download_with_http_info(path, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FileApi.file_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.file_get_download" end # resource path local_var_path = "/storage/file/{path}".sub('{' + 'path' + '}', path.to_s) # query parameters query_params = {} 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 auth_names = [] 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: FileApi#file_get_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Move a specific file. # # @param path source file path e.g. /file.ext # @param dest # @param [Hash] opts the optional parameters # @option opts [String] :version_id source file's version, # @option opts [String] :storage user's source storage name # @option opts [String] :dest_storage user's destination storage name # @return [MoveFileResponse] def file_post_move_file(path, dest, opts = {}) data, _status_code, _headers = file_post_move_file_with_http_info(path, dest, opts) return data end # Move a specific file. # # @param path source file path e.g. /file.ext # @param dest # @param [Hash] opts the optional parameters # @option opts [String] :version_id source file's version, # @option opts [String] :storage user's source storage name # @option opts [String] :dest_storage user's destination storage name # @return [Array<(MoveFileResponse, Fixnum, Hash)>] MoveFileResponse data, response status code and response headers def file_post_move_file_with_http_info(path, dest, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FileApi.file_post_move_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.file_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.file_post_move_file" end # resource path local_var_path = "/storage/file/{path}".sub('{' + 'path' + '}', path.to_s) # query parameters query_params = {} 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']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = [] 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, :auth_names => auth_names, :return_type => 'MoveFileResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_post_move_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Upload a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file's version, storage - user's source storage name, newdest - destination file path, destStorage - user's destination storage name. # # @param path # @param file file to upload # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [SaaSposeResponse] def file_put_create(path, file, opts = {}) data, _status_code, _headers = file_put_create_with_http_info(path, file, opts) return data end # Upload a specific file. Parameters: path - source file path e.g. /file.ext, versionID - source file's version, storage - user's source storage name, newdest - destination file path, destStorage - user's destination storage name. # # @param path # @param file file to upload # @param [Hash] opts the optional parameters # @option opts [String] :version_id # @option opts [String] :storage # @return [Array<(SaaSposeResponse, Fixnum, Hash)>] SaaSposeResponse data, response status code and response headers def file_put_create_with_http_info(path, file, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: FileApi.file_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.file_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.file_put_create" end # resource path local_var_path = "/storage/file/{path}".sub('{' + 'path' + '}', path.to_s) # query parameters query_params = {} 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(['multipart/form-data']) # form parameters form_params = {} form_params["file"] = file # http body (model) post_body = nil auth_names = [] 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 => 'SaaSposeResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: FileApi#file_put_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end