=begin
#Dependency-Track API

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 3.8.0

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1

=end

require 'cgi'

module DependencyTracker
  class MetricsApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Returns current metrics for a specific component
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [ComponentMetrics]
    def get_component_current_metrics(uuid, opts = {})
      data, _status_code, _headers = get_component_current_metrics_with_http_info(uuid, opts)
      data
    end

    # Returns current metrics for a specific component
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(ComponentMetrics, Integer, Hash)>] ComponentMetrics data, response status code and response headers
    def get_component_current_metrics_with_http_info(uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_component_current_metrics ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_component_current_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/component/{uuid}/current'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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] || 'ComponentMetrics' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_component_current_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns historical metrics for a specific component from a specific date
    # Date format must be YYYYMMDD
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<ComponentMetrics>]
    def get_component_metrics_since(uuid, date, opts = {})
      data, _status_code, _headers = get_component_metrics_since_with_http_info(uuid, date, opts)
      data
    end

    # Returns historical metrics for a specific component from a specific date
    # Date format must be YYYYMMDD
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ComponentMetrics>, Integer, Hash)>] Array<ComponentMetrics> data, response status code and response headers
    def get_component_metrics_since_with_http_info(uuid, date, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_component_metrics_since ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_component_metrics_since"
      end
      # verify the required parameter 'date' is set
      if @api_client.config.client_side_validation && date.nil?
        fail ArgumentError, "Missing the required parameter 'date' when calling MetricsApi.get_component_metrics_since"
      end
      # resource path
      local_var_path = '/v1/metrics/component/{uuid}/since/{date}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'date' + '}', CGI.escape(date.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] || 'Array<ComponentMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_component_metrics_since\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns X days of historical metrics for a specific component
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<ComponentMetrics>]
    def get_component_metrics_x_days(uuid, days, opts = {})
      data, _status_code, _headers = get_component_metrics_x_days_with_http_info(uuid, days, opts)
      data
    end

    # Returns X days of historical metrics for a specific component
    # @param uuid [String] The UUID of the component to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ComponentMetrics>, Integer, Hash)>] Array<ComponentMetrics> data, response status code and response headers
    def get_component_metrics_x_days_with_http_info(uuid, days, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_component_metrics_x_days ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_component_metrics_x_days"
      end
      # verify the required parameter 'days' is set
      if @api_client.config.client_side_validation && days.nil?
        fail ArgumentError, "Missing the required parameter 'days' when calling MetricsApi.get_component_metrics_x_days"
      end
      # resource path
      local_var_path = '/v1/metrics/component/{uuid}/days/{days}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'days' + '}', CGI.escape(days.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] || 'Array<ComponentMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_component_metrics_x_days\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns current metrics for a specific dependency
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [DependencyMetrics]
    def get_dependency_current_metrics(project_uuid, component_uuid, opts = {})
      data, _status_code, _headers = get_dependency_current_metrics_with_http_info(project_uuid, component_uuid, opts)
      data
    end

    # Returns current metrics for a specific dependency
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(DependencyMetrics, Integer, Hash)>] DependencyMetrics data, response status code and response headers
    def get_dependency_current_metrics_with_http_info(project_uuid, component_uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_dependency_current_metrics ...'
      end
      # verify the required parameter 'project_uuid' is set
      if @api_client.config.client_side_validation && project_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'project_uuid' when calling MetricsApi.get_dependency_current_metrics"
      end
      # verify the required parameter 'component_uuid' is set
      if @api_client.config.client_side_validation && component_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'component_uuid' when calling MetricsApi.get_dependency_current_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{projectUuid}/component/{componentUuid}/current'.sub('{' + 'projectUuid' + '}', CGI.escape(project_uuid.to_s)).sub('{' + 'componentUuid' + '}', CGI.escape(component_uuid.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] || 'DependencyMetrics' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_dependency_current_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns historical metrics for a specific dependency from a specific date
    # Date format must be YYYYMMDD
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<DependencyMetrics>]
    def get_dependency_metrics_since(project_uuid, component_uuid, date, opts = {})
      data, _status_code, _headers = get_dependency_metrics_since_with_http_info(project_uuid, component_uuid, date, opts)
      data
    end

    # Returns historical metrics for a specific dependency from a specific date
    # Date format must be YYYYMMDD
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<DependencyMetrics>, Integer, Hash)>] Array<DependencyMetrics> data, response status code and response headers
    def get_dependency_metrics_since_with_http_info(project_uuid, component_uuid, date, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_dependency_metrics_since ...'
      end
      # verify the required parameter 'project_uuid' is set
      if @api_client.config.client_side_validation && project_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'project_uuid' when calling MetricsApi.get_dependency_metrics_since"
      end
      # verify the required parameter 'component_uuid' is set
      if @api_client.config.client_side_validation && component_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'component_uuid' when calling MetricsApi.get_dependency_metrics_since"
      end
      # verify the required parameter 'date' is set
      if @api_client.config.client_side_validation && date.nil?
        fail ArgumentError, "Missing the required parameter 'date' when calling MetricsApi.get_dependency_metrics_since"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{projectUuid}/component/{componentUuid}/since/{date}'.sub('{' + 'projectUuid' + '}', CGI.escape(project_uuid.to_s)).sub('{' + 'componentUuid' + '}', CGI.escape(component_uuid.to_s)).sub('{' + 'date' + '}', CGI.escape(date.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] || 'Array<DependencyMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_dependency_metrics_since\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns X days of historical metrics for a specific dependency
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<DependencyMetrics>]
    def get_dependency_metrics_x_days(project_uuid, component_uuid, days, opts = {})
      data, _status_code, _headers = get_dependency_metrics_x_days_with_http_info(project_uuid, component_uuid, days, opts)
      data
    end

    # Returns X days of historical metrics for a specific dependency
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<DependencyMetrics>, Integer, Hash)>] Array<DependencyMetrics> data, response status code and response headers
    def get_dependency_metrics_x_days_with_http_info(project_uuid, component_uuid, days, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_dependency_metrics_x_days ...'
      end
      # verify the required parameter 'project_uuid' is set
      if @api_client.config.client_side_validation && project_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'project_uuid' when calling MetricsApi.get_dependency_metrics_x_days"
      end
      # verify the required parameter 'component_uuid' is set
      if @api_client.config.client_side_validation && component_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'component_uuid' when calling MetricsApi.get_dependency_metrics_x_days"
      end
      # verify the required parameter 'days' is set
      if @api_client.config.client_side_validation && days.nil?
        fail ArgumentError, "Missing the required parameter 'days' when calling MetricsApi.get_dependency_metrics_x_days"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{projectUuid}/component/{componentUuid}/days/{days}'.sub('{' + 'projectUuid' + '}', CGI.escape(project_uuid.to_s)).sub('{' + 'componentUuid' + '}', CGI.escape(component_uuid.to_s)).sub('{' + 'days' + '}', CGI.escape(days.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] || 'Array<DependencyMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_dependency_metrics_x_days\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns current metrics for the entire portfolio
    # @param [Hash] opts the optional parameters
    # @return [PortfolioMetrics]
    def get_portfolio_current_metrics(opts = {})
      data, _status_code, _headers = get_portfolio_current_metrics_with_http_info(opts)
      data
    end

    # Returns current metrics for the entire portfolio
    # @param [Hash] opts the optional parameters
    # @return [Array<(PortfolioMetrics, Integer, Hash)>] PortfolioMetrics data, response status code and response headers
    def get_portfolio_current_metrics_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_portfolio_current_metrics ...'
      end
      # resource path
      local_var_path = '/v1/metrics/portfolio/current'

      # 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] || 'PortfolioMetrics' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_portfolio_current_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns historical metrics for the entire portfolio from a specific date
    # Date format must be YYYYMMDD
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<PortfolioMetrics>]
    def get_portfolio_metrics_since(date, opts = {})
      data, _status_code, _headers = get_portfolio_metrics_since_with_http_info(date, opts)
      data
    end

    # Returns historical metrics for the entire portfolio from a specific date
    # Date format must be YYYYMMDD
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<PortfolioMetrics>, Integer, Hash)>] Array<PortfolioMetrics> data, response status code and response headers
    def get_portfolio_metrics_since_with_http_info(date, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_portfolio_metrics_since ...'
      end
      # verify the required parameter 'date' is set
      if @api_client.config.client_side_validation && date.nil?
        fail ArgumentError, "Missing the required parameter 'date' when calling MetricsApi.get_portfolio_metrics_since"
      end
      # resource path
      local_var_path = '/v1/metrics/portfolio/since/{date}'.sub('{' + 'date' + '}', CGI.escape(date.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] || 'Array<PortfolioMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_portfolio_metrics_since\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns X days of historical metrics for the entire portfolio
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<PortfolioMetrics>]
    def get_portfolio_metrics_x_days(days, opts = {})
      data, _status_code, _headers = get_portfolio_metrics_x_days_with_http_info(days, opts)
      data
    end

    # Returns X days of historical metrics for the entire portfolio
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<PortfolioMetrics>, Integer, Hash)>] Array<PortfolioMetrics> data, response status code and response headers
    def get_portfolio_metrics_x_days_with_http_info(days, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_portfolio_metrics_x_days ...'
      end
      # verify the required parameter 'days' is set
      if @api_client.config.client_side_validation && days.nil?
        fail ArgumentError, "Missing the required parameter 'days' when calling MetricsApi.get_portfolio_metrics_x_days"
      end
      # resource path
      local_var_path = '/v1/metrics/portfolio/{days}/days'.sub('{' + 'days' + '}', CGI.escape(days.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] || 'Array<PortfolioMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_portfolio_metrics_x_days\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns current metrics for a specific project
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [ProjectMetrics]
    def get_project_current_metrics(uuid, opts = {})
      data, _status_code, _headers = get_project_current_metrics_with_http_info(uuid, opts)
      data
    end

    # Returns current metrics for a specific project
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(ProjectMetrics, Integer, Hash)>] ProjectMetrics data, response status code and response headers
    def get_project_current_metrics_with_http_info(uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_project_current_metrics ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_project_current_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{uuid}/current'.sub('{' + 'uuid' + '}', CGI.escape(uuid.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] || 'ProjectMetrics' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_project_current_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns historical metrics for a specific project from a specific date
    # Date format must be YYYYMMDD
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<ProjectMetrics>]
    def get_project_metrics_since(uuid, date, opts = {})
      data, _status_code, _headers = get_project_metrics_since_with_http_info(uuid, date, opts)
      data
    end

    # Returns historical metrics for a specific project from a specific date
    # Date format must be YYYYMMDD
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param date [String] The start date to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ProjectMetrics>, Integer, Hash)>] Array<ProjectMetrics> data, response status code and response headers
    def get_project_metrics_since_with_http_info(uuid, date, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_project_metrics_since ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_project_metrics_since"
      end
      # verify the required parameter 'date' is set
      if @api_client.config.client_side_validation && date.nil?
        fail ArgumentError, "Missing the required parameter 'date' when calling MetricsApi.get_project_metrics_since"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{uuid}/since/{date}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'date' + '}', CGI.escape(date.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] || 'Array<ProjectMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_project_metrics_since\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns X days of historical metrics for a specific project
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<ProjectMetrics>]
    def get_project_metrics_x_days(uuid, days, opts = {})
      data, _status_code, _headers = get_project_metrics_x_days_with_http_info(uuid, days, opts)
      data
    end

    # Returns X days of historical metrics for a specific project
    # @param uuid [String] The UUID of the project to retrieve metrics for
    # @param days [Integer] The number of days back to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<ProjectMetrics>, Integer, Hash)>] Array<ProjectMetrics> data, response status code and response headers
    def get_project_metrics_x_days_with_http_info(uuid, days, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_project_metrics_x_days ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.get_project_metrics_x_days"
      end
      # verify the required parameter 'days' is set
      if @api_client.config.client_side_validation && days.nil?
        fail ArgumentError, "Missing the required parameter 'days' when calling MetricsApi.get_project_metrics_x_days"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{uuid}/days/{days}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)).sub('{' + 'days' + '}', CGI.escape(days.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] || 'Array<ProjectMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_project_metrics_x_days\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Returns the sum of all vulnerabilities in the database by year and month
    # @param [Hash] opts the optional parameters
    # @return [Array<VulnerabilityMetrics>]
    def get_vulnerability_metrics(opts = {})
      data, _status_code, _headers = get_vulnerability_metrics_with_http_info(opts)
      data
    end

    # Returns the sum of all vulnerabilities in the database by year and month
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<VulnerabilityMetrics>, Integer, Hash)>] Array<VulnerabilityMetrics> data, response status code and response headers
    def get_vulnerability_metrics_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.get_vulnerability_metrics ...'
      end
      # resource path
      local_var_path = '/v1/metrics/vulnerability'

      # 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] || 'Array<VulnerabilityMetrics>' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#get_vulnerability_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Requests a refresh of a specific components metrics
    # @param uuid [String] The UUID of the component to refresh metrics on
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def refresh_component_metrics(uuid, opts = {})
      refresh_component_metrics_with_http_info(uuid, opts)
      nil
    end

    # Requests a refresh of a specific components metrics
    # @param uuid [String] The UUID of the component to refresh metrics on
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def refresh_component_metrics_with_http_info(uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.refresh_component_metrics ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.refresh_component_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/component/{uuid}/refresh'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:body] 

      # return_type
      return_type = opts[:return_type] 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#refresh_component_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Requests a refresh of a specific dependency metrics
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def refresh_dependency_metrics(project_uuid, component_uuid, opts = {})
      refresh_dependency_metrics_with_http_info(project_uuid, component_uuid, opts)
      nil
    end

    # Requests a refresh of a specific dependency metrics
    # @param project_uuid [String] The UUID of the project to retrieve metrics for
    # @param component_uuid [String] The UUID of the component to retrieve metrics for
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def refresh_dependency_metrics_with_http_info(project_uuid, component_uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.refresh_dependency_metrics ...'
      end
      # verify the required parameter 'project_uuid' is set
      if @api_client.config.client_side_validation && project_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'project_uuid' when calling MetricsApi.refresh_dependency_metrics"
      end
      # verify the required parameter 'component_uuid' is set
      if @api_client.config.client_side_validation && component_uuid.nil?
        fail ArgumentError, "Missing the required parameter 'component_uuid' when calling MetricsApi.refresh_dependency_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{projectUuid}/component/{componentUuid}/refresh'.sub('{' + 'projectUuid' + '}', CGI.escape(project_uuid.to_s)).sub('{' + 'componentUuid' + '}', CGI.escape(component_uuid.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:body] 

      # return_type
      return_type = opts[:return_type] 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#refresh_dependency_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Requests a refresh of the portfolio metrics
    # @param [Hash] opts the optional parameters
    # @return [PortfolioMetrics]
    def refresh_portfolio_metrics(opts = {})
      data, _status_code, _headers = refresh_portfolio_metrics_with_http_info(opts)
      data
    end

    # Requests a refresh of the portfolio metrics
    # @param [Hash] opts the optional parameters
    # @return [Array<(PortfolioMetrics, Integer, Hash)>] PortfolioMetrics data, response status code and response headers
    def refresh_portfolio_metrics_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.refresh_portfolio_metrics ...'
      end
      # resource path
      local_var_path = '/v1/metrics/portfolio/refresh'

      # 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] || 'PortfolioMetrics' 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#refresh_portfolio_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Requests a refresh of a specific projects metrics
    # @param uuid [String] The UUID of the project to refresh metrics on
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def refresh_project_metrics(uuid, opts = {})
      refresh_project_metrics_with_http_info(uuid, opts)
      nil
    end

    # Requests a refresh of a specific projects metrics
    # @param uuid [String] The UUID of the project to refresh metrics on
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
    def refresh_project_metrics_with_http_info(uuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: MetricsApi.refresh_project_metrics ...'
      end
      # verify the required parameter 'uuid' is set
      if @api_client.config.client_side_validation && uuid.nil?
        fail ArgumentError, "Missing the required parameter 'uuid' when calling MetricsApi.refresh_project_metrics"
      end
      # resource path
      local_var_path = '/v1/metrics/project/{uuid}/refresh'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

      # query parameters
      query_params = opts[:query_params] || {}

      # header parameters
      header_params = opts[:header_params] || {}

      # form parameters
      form_params = opts[:form_params] || {}

      # http body (model)
      post_body = opts[:body] 

      # return_type
      return_type = opts[:return_type] 

      # auth_names
      auth_names = opts[:auth_names] || ['X-Api-Key']

      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: MetricsApi#refresh_project_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
