=begin #Cloudsmith API #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.2.3 =end require "uri" module CloudsmithApi class VulnerabilitiesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Read-only view to list vulnerabiltiy scan results within a Namespace. # Read-only view to list vulnerabiltiy scan results within a 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_list(owner, opts = {}) data, _status_code, _headers = vulnerabilities_list_with_http_info(owner, opts) return data end # Read-only view to list vulnerabiltiy scan results within a Namespace. # Read-only view to list vulnerabiltiy scan results within a 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_list_with_http_info(owner, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: VulnerabilitiesApi.vulnerabilities_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_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 = {} # 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Read-only views to list vulnerabiltiy scan results within a Repository. # Read-only views to list vulnerabiltiy scan results within a 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_list0(owner, repo, opts = {}) data, _status_code, _headers = vulnerabilities_list0_with_http_info(owner, repo, opts) return data end # Read-only views to list vulnerabiltiy scan results within a Repository. # Read-only views to list vulnerabiltiy scan results within a 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_list0_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: VulnerabilitiesApi.vulnerabilities_list0 ..." 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_list0" 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_list0" 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 = {} # 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_list0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Read-only views to list vulnerabiltiy scan results within a Repository # Read-only views to list vulnerabiltiy scan results within a Repository for a given Package identifier. # @param owner # @param repo # @param package The package that the scan result relates to. # @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_list1(owner, repo, package, opts = {}) data, _status_code, _headers = vulnerabilities_list1_with_http_info(owner, repo, package, opts) return data end # Read-only views to list vulnerabiltiy scan results within a Repository # Read-only views to list vulnerabiltiy scan results within a Repository for a given Package identifier. # @param owner # @param repo # @param package The package that the scan result relates to. # @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_list1_with_http_info(owner, repo, package, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: VulnerabilitiesApi.vulnerabilities_list1 ..." 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_list1" 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_list1" 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_list1" 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 = {} # 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: VulnerabilitiesApi#vulnerabilities_list1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Read-only view to retrieve vulnerability scans results using a # Read-only view to retrieve vulnerability scans results using a vulnerabiltiy scan results identifier (slug_perm). # @param owner # @param repo # @param package The package that the scan result relates to. # @param scan_id A sequential identifier that increments by one for each new scan result within a package. These are always unique and can be used to reference the scan results elsewhere (e.g. via the CLI.) # @param [Hash] opts the optional parameters # @return [VulnerabilityScanResults] def vulnerabilities_read(owner, repo, package, scan_id, opts = {}) data, _status_code, _headers = vulnerabilities_read_with_http_info(owner, repo, package, scan_id, opts) return data end # Read-only view to retrieve vulnerability scans results using a # Read-only view to retrieve vulnerability scans results using a vulnerabiltiy scan results identifier (slug_perm). # @param owner # @param repo # @param package The package that the scan result relates to. # @param scan_id A sequential identifier that increments by one for each new scan result within a package. These are always unique and can be used to reference the scan results elsewhere (e.g. via the CLI.) # @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, scan_id, 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 'scan_id' is set if @api_client.config.client_side_validation && scan_id.nil? fail ArgumentError, "Missing the required parameter 'scan_id' when calling VulnerabilitiesApi.vulnerabilities_read" end # resource path local_var_path = "/vulnerabilities/{owner}/{repo}/{package}/{scan_id}/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s).sub('{' + 'package' + '}', package.to_s).sub('{' + 'scan_id' + '}', scan_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # 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 => '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 end end