=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 BadgesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get latest package version for a package or package group. # Get latest package version for a package or package group. # @param owner # @param repo # @param package_format # @param package_name # @param package_version # @param package_identifiers # @param [Hash] opts the optional parameters # @option opts [String] :badge_token Badge token to authenticate for private packages (default to ) # @option opts [String] :cache_seconds Override the shields.io badge cacheSeconds value. (default to 300) # @option opts [String] :color Override the shields.io badge color value. (default to 12577E) # @option opts [String] :label Override the shields.io badge label value. (default to cloudsmith) # @option opts [String] :label_color Override the shields.io badge labelColor value. (default to 021F2F) # @option opts [String] :logo_color Override the shields.io badge logoColor value. (default to 45B6EE) # @option opts [String] :logo_width Override the shields.io badge logoWidth value. (default to 10) # @option opts [BOOLEAN] :render If true, badge will be rendered (default to false) # @option opts [BOOLEAN] :shields If true, a shields response will be generated (default to false) # @option opts [BOOLEAN] :show_latest If true, for latest version badges a '(latest)' suffix is added (default to false) # @option opts [String] :style Override the shields.io badge style value. (default to flat-square) # @return [PackageVersionBadge] def badges_version_list(owner, repo, package_format, package_name, package_version, package_identifiers, opts = {}) data, _status_code, _headers = badges_version_list_with_http_info(owner, repo, package_format, package_name, package_version, package_identifiers, opts) data end # Get latest package version for a package or package group. # Get latest package version for a package or package group. # @param owner # @param repo # @param package_format # @param package_name # @param package_version # @param package_identifiers # @param [Hash] opts the optional parameters # @option opts [String] :badge_token Badge token to authenticate for private packages # @option opts [String] :cache_seconds Override the shields.io badge cacheSeconds value. # @option opts [String] :color Override the shields.io badge color value. # @option opts [String] :label Override the shields.io badge label value. # @option opts [String] :label_color Override the shields.io badge labelColor value. # @option opts [String] :logo_color Override the shields.io badge logoColor value. # @option opts [String] :logo_width Override the shields.io badge logoWidth value. # @option opts [BOOLEAN] :render If true, badge will be rendered # @option opts [BOOLEAN] :shields If true, a shields response will be generated # @option opts [BOOLEAN] :show_latest If true, for latest version badges a '(latest)' suffix is added # @option opts [String] :style Override the shields.io badge style value. # @return [Array<(PackageVersionBadge, Fixnum, Hash)>] PackageVersionBadge data, response status code and response headers def badges_version_list_with_http_info(owner, repo, package_format, package_name, package_version, package_identifiers, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BadgesApi.badges_version_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 BadgesApi.badges_version_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 BadgesApi.badges_version_list" end # verify the required parameter 'package_format' is set if @api_client.config.client_side_validation && package_format.nil? fail ArgumentError, "Missing the required parameter 'package_format' when calling BadgesApi.badges_version_list" end # verify the required parameter 'package_name' is set if @api_client.config.client_side_validation && package_name.nil? fail ArgumentError, "Missing the required parameter 'package_name' when calling BadgesApi.badges_version_list" end # verify the required parameter 'package_version' is set if @api_client.config.client_side_validation && package_version.nil? fail ArgumentError, "Missing the required parameter 'package_version' when calling BadgesApi.badges_version_list" end # verify the required parameter 'package_identifiers' is set if @api_client.config.client_side_validation && package_identifiers.nil? fail ArgumentError, "Missing the required parameter 'package_identifiers' when calling BadgesApi.badges_version_list" end # resource path local_var_path = '/badges/version/{owner}/{repo}/{package_format}/{package_name}/{package_version}/{package_identifiers}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s).sub('{' + 'package_format' + '}', package_format.to_s).sub('{' + 'package_name' + '}', package_name.to_s).sub('{' + 'package_version' + '}', package_version.to_s).sub('{' + 'package_identifiers' + '}', package_identifiers.to_s) # query parameters query_params = {} query_params[:'badge_token'] = opts[:'badge_token'] if !opts[:'badge_token'].nil? query_params[:'cacheSeconds'] = opts[:'cache_seconds'] if !opts[:'cache_seconds'].nil? query_params[:'color'] = opts[:'color'] if !opts[:'color'].nil? query_params[:'label'] = opts[:'label'] if !opts[:'label'].nil? query_params[:'labelColor'] = opts[:'label_color'] if !opts[:'label_color'].nil? query_params[:'logoColor'] = opts[:'logo_color'] if !opts[:'logo_color'].nil? query_params[:'logoWidth'] = opts[:'logo_width'] if !opts[:'logo_width'].nil? query_params[:'render'] = opts[:'render'] if !opts[:'render'].nil? query_params[:'shields'] = opts[:'shields'] if !opts[:'shields'].nil? query_params[:'show_latest'] = opts[:'show_latest'] if !opts[:'show_latest'].nil? query_params[:'style'] = opts[:'style'] if !opts[:'style'].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 => 'PackageVersionBadge') if @api_client.config.debugging @api_client.config.logger.debug "API called: BadgesApi#badges_version_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end