=begin This is an automatically generated file. DO NOT EDIT. Generated from version 2.1.81 of the OpenAPI specification at https://github.com/athenianco/api-spec/releases/tag/2.1.81. Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.4.0 =end require 'cgi' module Athenian class MetricsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Measure the amount of code that was pushed outside of pull requests. # @param body [CodeFilter] Query for measuring the amount of code that was pushed outside of pull requests. # @param [Hash] opts the optional parameters # @return [Array] def calc_code_bypassing_prs(body, opts = {}) data, _status_code, _headers = calc_code_bypassing_prs_with_http_info(body, opts) data end # Measure the amount of code that was pushed outside of pull requests. # @param body [CodeFilter] Query for measuring the amount of code that was pushed outside of pull requests. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def calc_code_bypassing_prs_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_code_bypassing_prs ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_code_bypassing_prs" end # resource path local_var_path = '/metrics/code_bypassing_prs' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_code_bypassing_prs", :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: MetricsApi#calc_code_bypassing_prs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate metrics on continuous integration runs, such as GitHub Actions, Jenkins, Circle, etc. # @param body [CodeCheckMetricsRequest] Select the check runs of interest and the metrics to calculate. # @param [Hash] opts the optional parameters # @return [CalculatedCodeCheckMetrics] def calc_metrics_code_checks(body, opts = {}) data, _status_code, _headers = calc_metrics_code_checks_with_http_info(body, opts) data end # Calculate metrics on continuous integration runs, such as GitHub Actions, Jenkins, Circle, etc. # @param body [CodeCheckMetricsRequest] Select the check runs of interest and the metrics to calculate. # @param [Hash] opts the optional parameters # @return [Array<(CalculatedCodeCheckMetrics, Integer, Hash)>] CalculatedCodeCheckMetrics data, response status code and response headers def calc_metrics_code_checks_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_code_checks ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_code_checks" end # resource path local_var_path = '/metrics/code_checks' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CalculatedCodeCheckMetrics' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_code_checks", :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: MetricsApi#calc_metrics_code_checks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate metrics on deployments submitted by `/events/deployments`. # @param body [DeploymentMetricsRequest] Select the deployments of interest and the metrics to calculate. # @param [Hash] opts the optional parameters # @return [Array] def calc_metrics_deployments(body, opts = {}) data, _status_code, _headers = calc_metrics_deployments_with_http_info(body, opts) data end # Calculate metrics on deployments submitted by `/events/deployments`. # @param body [DeploymentMetricsRequest] Select the deployments of interest and the metrics to calculate. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def calc_metrics_deployments_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_deployments ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_deployments" end # resource path local_var_path = '/metrics/deployments' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_deployments", :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: MetricsApi#calc_metrics_deployments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate metrics over developer activities. # @param body [DeveloperMetricsRequest] Query for selecting developers and measured activities. # @param [Hash] opts the optional parameters # @return [CalculatedDeveloperMetrics] def calc_metrics_developers(body, opts = {}) data, _status_code, _headers = calc_metrics_developers_with_http_info(body, opts) data end # Calculate metrics over developer activities. # @param body [DeveloperMetricsRequest] Query for selecting developers and measured activities. # @param [Hash] opts the optional parameters # @return [Array<(CalculatedDeveloperMetrics, Integer, Hash)>] CalculatedDeveloperMetrics data, response status code and response headers def calc_metrics_developers_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_developers ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_developers" end # resource path local_var_path = '/metrics/developers' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CalculatedDeveloperMetrics' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_developers", :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: MetricsApi#calc_metrics_developers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate metrics over JIRA issue activities. # @param body [JIRAMetricsRequest] Query for selecting JIRA issues and measured activities. # @param [Hash] opts the optional parameters # @return [Array] def calc_metrics_jira_linear(body, opts = {}) data, _status_code, _headers = calc_metrics_jira_linear_with_http_info(body, opts) data end # Calculate metrics over JIRA issue activities. # @param body [JIRAMetricsRequest] Query for selecting JIRA issues and measured activities. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def calc_metrics_jira_linear_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_jira_linear ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_jira_linear" end # resource path local_var_path = '/metrics/jira' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_jira_linear", :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: MetricsApi#calc_metrics_jira_linear\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate linear metrics over PRs. # @param body [PullRequestMetricsRequest] Desired metric definitions. # @param [Hash] opts the optional parameters # @return [CalculatedPullRequestMetrics] def calc_metrics_prs(body, opts = {}) data, _status_code, _headers = calc_metrics_prs_with_http_info(body, opts) data end # Calculate linear metrics over PRs. # @param body [PullRequestMetricsRequest] Desired metric definitions. # @param [Hash] opts the optional parameters # @return [Array<(CalculatedPullRequestMetrics, Integer, Hash)>] CalculatedPullRequestMetrics data, response status code and response headers def calc_metrics_prs_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_prs ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_prs" end # resource path local_var_path = '/metrics/pull_requests' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'CalculatedPullRequestMetrics' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_prs", :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: MetricsApi#calc_metrics_prs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Calculate linear metrics over releases. # @param body [ReleaseMetricsRequest] Desired metric definitions. # @param [Hash] opts the optional parameters # @return [Array] def calc_metrics_releases(body, opts = {}) data, _status_code, _headers = calc_metrics_releases_with_http_info(body, opts) data end # Calculate linear metrics over releases. # @param body [ReleaseMetricsRequest] Desired metric definitions. # @param [Hash] opts the optional parameters # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def calc_metrics_releases_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MetricsApi.calc_metrics_releases ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling MetricsApi.calc_metrics_releases" end # resource path local_var_path = '/metrics/releases' # 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' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'bearerAuth'] new_options = opts.merge( :operation => :"MetricsApi.calc_metrics_releases", :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: MetricsApi#calc_metrics_releases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end