=begin #Cloudsmith API (v1) #The API to the Cloudsmith Service OpenAPI spec version: v1 Contact: support@cloudsmith.io Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.26 =end require 'uri' module CloudsmithApi class QuotaApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Quota history for a given namespace. # Quota history for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [QuotaHistory] def quota_history_read(owner, opts = {}) data, _status_code, _headers = quota_history_read_with_http_info(owner, opts) data end # Quota history for a given namespace. # Quota history for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Array<(QuotaHistory, Fixnum, Hash)>] QuotaHistory data, response status code and response headers def quota_history_read_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.quota_history_read ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_history_read" end # resource path local_var_path = '/quota/history/{owner}/'.sub('{' + 'owner' + '}', owner.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 = ['apikey'] 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 => 'QuotaHistory') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#quota_history_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Open-source Quota history for a given namespace. # Open-source Quota history for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [QuotaHistory] def quota_oss_history_read(owner, opts = {}) data, _status_code, _headers = quota_oss_history_read_with_http_info(owner, opts) data end # Open-source Quota history for a given namespace. # Open-source Quota history for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Array<(QuotaHistory, Fixnum, Hash)>] QuotaHistory data, response status code and response headers def quota_oss_history_read_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.quota_oss_history_read ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_history_read" end # resource path local_var_path = '/quota/oss/history/{owner}/'.sub('{' + 'owner' + '}', owner.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 = ['apikey'] 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 => 'QuotaHistory') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#quota_oss_history_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Open-source Quota usage for a given namespace. # Open-source Quota usage for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Quota] def quota_oss_read(owner, opts = {}) data, _status_code, _headers = quota_oss_read_with_http_info(owner, opts) data end # Open-source Quota usage for a given namespace. # Open-source Quota usage for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Array<(Quota, Fixnum, Hash)>] Quota data, response status code and response headers def quota_oss_read_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.quota_oss_read ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_read" end # resource path local_var_path = '/quota/oss/{owner}/'.sub('{' + 'owner' + '}', owner.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 = ['apikey'] 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 => 'Quota') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#quota_oss_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Quota usage for a given namespace. # Quota usage for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Quota] def quota_read(owner, opts = {}) data, _status_code, _headers = quota_read_with_http_info(owner, opts) data end # Quota usage for a given namespace. # Quota usage for a given namespace. # @param owner # @param [Hash] opts the optional parameters # @return [Array<(Quota, Fixnum, Hash)>] Quota data, response status code and response headers def quota_read_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: QuotaApi.quota_read ...' end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_read" end # resource path local_var_path = '/quota/{owner}/'.sub('{' + 'owner' + '}', owner.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 = ['apikey'] 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 => 'Quota') if @api_client.config.debugging @api_client.config.logger.debug "API called: QuotaApi#quota_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end