=begin #Pulp 3 API #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.0.0 =end require 'uri' module PulpFileClient class RemotesFileApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a file remote # FileRemote represents an external source of File Content. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [FileRemote] def create(data, opts = {}) data, _status_code, _headers = create_with_http_info(data, opts) data end # Create a file remote # <!-- User-facing documentation, rendered as html--> FileRemote represents an external source of <a href=\"#operation/content_file_files_list\">File Content</a>. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [Array<(FileRemote, Integer, Hash)>] FileRemote data, response status code and response headers def create_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.create ...' end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling RemotesFileApi.create" end # resource path local_var_path = '/pulp/api/v3/remotes/file/file/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:return_type] || 'FileRemote' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a file remote # Trigger an asynchronous delete task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param [Hash] opts the optional parameters # @return [AsyncOperationResponse] def delete(file_remote_href, opts = {}) data, _status_code, _headers = delete_with_http_info(file_remote_href, opts) data end # Delete a file remote # Trigger an asynchronous delete task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param [Hash] opts the optional parameters # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers def delete_with_http_info(file_remote_href, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.delete ...' end # verify the required parameter 'file_remote_href' is set if @api_client.config.client_side_validation && file_remote_href.nil? fail ArgumentError, "Missing the required parameter 'file_remote_href' when calling RemotesFileApi.delete" end # resource path local_var_path = '{file_remote_href}'.sub('{' + 'file_remote_href' + '}', file_remote_href.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AsyncOperationResponse' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List file remotes # FileRemote represents an external source of File Content. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param [Hash] opts the optional parameters # @option opts [String] :name # @option opts [String] :name__in Filter results where name is in a comma-separated list of values # @option opts [String] :_last_updated__lt Filter results where _last_updated is less than value # @option opts [String] :_last_updated__lte Filter results where _last_updated is less than or equal to value # @option opts [String] :_last_updated__gt Filter results where _last_updated is greater than value # @option opts [String] :_last_updated__gte Filter results where _last_updated is greater than or equal to value # @option opts [String] :_last_updated__range Filter results where _last_updated is between two comma separated values # @option opts [String] :_last_updated ISO 8601 formatted dates are supported # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @return [InlineResponse2003] def list(opts = {}) data, _status_code, _headers = list_with_http_info(opts) data end # List file remotes # <!-- User-facing documentation, rendered as html--> FileRemote represents an external source of <a href=\"#operation/content_file_files_list\">File Content</a>. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param [Hash] opts the optional parameters # @option opts [String] :name # @option opts [String] :name__in Filter results where name is in a comma-separated list of values # @option opts [String] :_last_updated__lt Filter results where _last_updated is less than value # @option opts [String] :_last_updated__lte Filter results where _last_updated is less than or equal to value # @option opts [String] :_last_updated__gt Filter results where _last_updated is greater than value # @option opts [String] :_last_updated__gte Filter results where _last_updated is greater than or equal to value # @option opts [String] :_last_updated__range Filter results where _last_updated is between two comma separated values # @option opts [String] :_last_updated ISO 8601 formatted dates are supported # @option opts [Integer] :page A page number within the paginated result set. # @option opts [Integer] :page_size Number of results to return per page. # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers def list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.list ...' end # resource path local_var_path = '/pulp/api/v3/remotes/file/file/' # query parameters query_params = opts[:query_params] || {} query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'name__in'] = opts[:'name__in'] if !opts[:'name__in'].nil? query_params[:'_last_updated__lt'] = opts[:'_last_updated__lt'] if !opts[:'_last_updated__lt'].nil? query_params[:'_last_updated__lte'] = opts[:'_last_updated__lte'] if !opts[:'_last_updated__lte'].nil? query_params[:'_last_updated__gt'] = opts[:'_last_updated__gt'] if !opts[:'_last_updated__gt'].nil? query_params[:'_last_updated__gte'] = opts[:'_last_updated__gte'] if !opts[:'_last_updated__gte'].nil? query_params[:'_last_updated__range'] = opts[:'_last_updated__range'] if !opts[:'_last_updated__range'].nil? query_params[:'_last_updated'] = opts[:'_last_updated'] if !opts[:'_last_updated'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2003' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Partially update a file remote # Trigger an asynchronous partial update task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [AsyncOperationResponse] def partial_update(file_remote_href, data, opts = {}) data, _status_code, _headers = partial_update_with_http_info(file_remote_href, data, opts) data end # Partially update a file remote # Trigger an asynchronous partial update task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers def partial_update_with_http_info(file_remote_href, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.partial_update ...' end # verify the required parameter 'file_remote_href' is set if @api_client.config.client_side_validation && file_remote_href.nil? fail ArgumentError, "Missing the required parameter 'file_remote_href' when calling RemotesFileApi.partial_update" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling RemotesFileApi.partial_update" end # resource path local_var_path = '{file_remote_href}'.sub('{' + 'file_remote_href' + '}', file_remote_href.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:return_type] || 'AsyncOperationResponse' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Inspect a file remote # FileRemote represents an external source of File Content. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param [Hash] opts the optional parameters # @return [FileRemote] def read(file_remote_href, opts = {}) data, _status_code, _headers = read_with_http_info(file_remote_href, opts) data end # Inspect a file remote # <!-- User-facing documentation, rendered as html--> FileRemote represents an external source of <a href=\"#operation/content_file_files_list\">File Content</a>. The target url of a FileRemote must contain a file manifest, which contains the metadata for all files at the source. # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param [Hash] opts the optional parameters # @return [Array<(FileRemote, Integer, Hash)>] FileRemote data, response status code and response headers def read_with_http_info(file_remote_href, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.read ...' end # verify the required parameter 'file_remote_href' is set if @api_client.config.client_side_validation && file_remote_href.nil? fail ArgumentError, "Missing the required parameter 'file_remote_href' when calling RemotesFileApi.read" end # resource path local_var_path = '{file_remote_href}'.sub('{' + 'file_remote_href' + '}', file_remote_href.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'FileRemote' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Trigger an asynchronous task to sync file content. # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [RepositorySyncURL] # @param [Hash] opts the optional parameters # @return [AsyncOperationResponse] def sync(file_remote_href, data, opts = {}) data, _status_code, _headers = sync_with_http_info(file_remote_href, data, opts) data end # Trigger an asynchronous task to sync file content. # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [RepositorySyncURL] # @param [Hash] opts the optional parameters # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers def sync_with_http_info(file_remote_href, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.sync ...' end # verify the required parameter 'file_remote_href' is set if @api_client.config.client_side_validation && file_remote_href.nil? fail ArgumentError, "Missing the required parameter 'file_remote_href' when calling RemotesFileApi.sync" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling RemotesFileApi.sync" end # resource path local_var_path = '{file_remote_href}sync/'.sub('{' + 'file_remote_href' + '}', file_remote_href.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:return_type] || 'AsyncOperationResponse' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a file remote # Trigger an asynchronous update task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [AsyncOperationResponse] def update(file_remote_href, data, opts = {}) data, _status_code, _headers = update_with_http_info(file_remote_href, data, opts) data end # Update a file remote # Trigger an asynchronous update task # @param file_remote_href [String] URI of File Remote. e.g.: /pulp/api/v3/remotes/file/file/1/ # @param data [FileRemote] # @param [Hash] opts the optional parameters # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers def update_with_http_info(file_remote_href, data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: RemotesFileApi.update ...' end # verify the required parameter 'file_remote_href' is set if @api_client.config.client_side_validation && file_remote_href.nil? fail ArgumentError, "Missing the required parameter 'file_remote_href' when calling RemotesFileApi.update" end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling RemotesFileApi.update" end # resource path local_var_path = '{file_remote_href}'.sub('{' + 'file_remote_href' + '}', file_remote_href.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(data) # return_type return_type = opts[:return_type] || 'AsyncOperationResponse' # auth_names auth_names = opts[:auth_names] || ['Basic'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: RemotesFileApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end