=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 VulnerabilitiesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Lists scan results for a specific namespace. # Lists scan results for a specific namespace. # @param owner # @param [Hash] opts the optional parameters # @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] def vulnerabilities_namespace_list(owner, opts = {}) data, _status_code, _headers = vulnerabilities_namespace_list_with_http_info(owner, opts) data end # Lists scan results for a specific namespace. # Lists scan results for a specific namespace. # @param owner # @param [Hash] opts the optional parameters # @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<(Array, Fixnum, Hash)>] Array data, response status code and response headers def vulnerabilities_namespace_list_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VulnerabilitiesApi.vulnerabilities_namespace_list ...' 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 VulnerabilitiesApi.vulnerabilities_namespace_list" end # resource path local_var_path = '/vulnerabilities/{owner}/'.sub('{' + 'owner' + '}', owner.to_s) # query parameters query_params = {} 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 = {} # 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', 'basic'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_namespace_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists scan results for a specific package. # Lists scan results for a specific package. # @param owner # @param repo # @param package # @param [Hash] opts the optional parameters # @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] def vulnerabilities_package_list(owner, repo, package, opts = {}) data, _status_code, _headers = vulnerabilities_package_list_with_http_info(owner, repo, package, opts) data end # Lists scan results for a specific package. # Lists scan results for a specific package. # @param owner # @param repo # @param package # @param [Hash] opts the optional parameters # @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<(Array, Fixnum, Hash)>] Array data, response status code and response headers def vulnerabilities_package_list_with_http_info(owner, repo, package, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VulnerabilitiesApi.vulnerabilities_package_list ...' 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 VulnerabilitiesApi.vulnerabilities_package_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling VulnerabilitiesApi.vulnerabilities_package_list" end # verify the required parameter 'package' is set if @api_client.config.client_side_validation && package.nil? fail ArgumentError, "Missing the required parameter 'package' when calling VulnerabilitiesApi.vulnerabilities_package_list" end # resource path local_var_path = '/vulnerabilities/{owner}/{repo}/{package}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s).sub('{' + 'package' + '}', package.to_s) # query parameters query_params = {} 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 = {} # 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', 'basic'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_package_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a scan result. # Get a scan result. # @param owner # @param repo # @param package # @param identifier # @param [Hash] opts the optional parameters # @return [VulnerabilityScanResults] def vulnerabilities_read(owner, repo, package, identifier, opts = {}) data, _status_code, _headers = vulnerabilities_read_with_http_info(owner, repo, package, identifier, opts) data end # Get a scan result. # Get a scan result. # @param owner # @param repo # @param package # @param identifier # @param [Hash] opts the optional parameters # @return [Array<(VulnerabilityScanResults, Fixnum, Hash)>] VulnerabilityScanResults data, response status code and response headers def vulnerabilities_read_with_http_info(owner, repo, package, identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VulnerabilitiesApi.vulnerabilities_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 VulnerabilitiesApi.vulnerabilities_read" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling VulnerabilitiesApi.vulnerabilities_read" end # verify the required parameter 'package' is set if @api_client.config.client_side_validation && package.nil? fail ArgumentError, "Missing the required parameter 'package' when calling VulnerabilitiesApi.vulnerabilities_read" end # verify the required parameter 'identifier' is set if @api_client.config.client_side_validation && identifier.nil? fail ArgumentError, "Missing the required parameter 'identifier' when calling VulnerabilitiesApi.vulnerabilities_read" end # resource path local_var_path = '/vulnerabilities/{owner}/{repo}/{package}/{identifier}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s).sub('{' + 'package' + '}', package.to_s).sub('{' + 'identifier' + '}', identifier.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', 'basic'] 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 => 'VulnerabilityScanResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists scan results for a specific repository. # Lists scan results for a specific repository. # @param owner # @param repo # @param [Hash] opts the optional parameters # @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] def vulnerabilities_repo_list(owner, repo, opts = {}) data, _status_code, _headers = vulnerabilities_repo_list_with_http_info(owner, repo, opts) data end # Lists scan results for a specific repository. # Lists scan results for a specific repository. # @param owner # @param repo # @param [Hash] opts the optional parameters # @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<(Array, Fixnum, Hash)>] Array data, response status code and response headers def vulnerabilities_repo_list_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: VulnerabilitiesApi.vulnerabilities_repo_list ...' 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 VulnerabilitiesApi.vulnerabilities_repo_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling VulnerabilitiesApi.vulnerabilities_repo_list" end # resource path local_var_path = '/vulnerabilities/{owner}/{repo}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} 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 = {} # 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', 'basic'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_repo_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end