class DependencyTracker::ComponentApi
Attributes
Public Class Methods
# File lib/dependency-tracker-client/api/component_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Creates a new component @param [Hash] opts the optional parameters @option opts [Component] :body @return [Component]
# File lib/dependency-tracker-client/api/component_api.rb, line 26 def create_component(opts = {}) data, _status_code, _headers = create_component_with_http_info(opts) data end
Creates a new component @param [Hash] opts the optional parameters @option opts [Component] :body @return [Array<(Component
, Integer, Hash)>] Component
data, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 35 def create_component_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.create_component ...' end # resource path local_var_path = '/v1/component' # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:return_type] || 'Component' # 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(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ComponentApi#create_component\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Deletes a component @param uuid [String] The UUID of the component to delete @param [Hash] opts the optional parameters @return [nil]
# File lib/dependency-tracker-client/api/component_api.rb, line 84 def delete_component(uuid, opts = {}) delete_component_with_http_info(uuid, opts) nil end
Deletes a component @param uuid [String] The UUID of the component to delete @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 93 def delete_component_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.delete_component ...' 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 ComponentApi.delete_component" end # resource path local_var_path = '/v1/component/{uuid}'.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(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ComponentApi#delete_component\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns a list of all components @param [Hash] opts the optional parameters @return [Array<Component>]
# File lib/dependency-tracker-client/api/component_api.rb, line 141 def get_all_components(opts = {}) data, _status_code, _headers = get_all_components_with_http_info(opts) data end
Returns a list of all components @param [Hash] opts the optional parameters @return [Array<(Array<Component>, Integer, Hash)>] Array<Component> data, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 149 def get_all_components_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.get_all_components ...' end # resource path local_var_path = '/v1/component' # 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<Component>' # 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: ComponentApi#get_all_components\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns a specific component @param hash [String] The MD5, SHA-1, SHA-256, SHA-512, SHA3-256, or SHA3-512 hash of the component to retrieve @param [Hash] opts the optional parameters @return [Component]
# File lib/dependency-tracker-client/api/component_api.rb, line 196 def get_component_by_hash(hash, opts = {}) data, _status_code, _headers = get_component_by_hash_with_http_info(hash, opts) data end
Returns a specific component @param hash [String] The MD5, SHA-1, SHA-256, SHA-512, SHA3-256, or SHA3-512 hash of the component to retrieve @param [Hash] opts the optional parameters @return [Array<(Component
, Integer, Hash)>] Component
data, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 205 def get_component_by_hash_with_http_info(hash, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.get_component_by_hash ...' end # verify the required parameter 'hash' is set if @api_client.config.client_side_validation && hash.nil? fail ArgumentError, "Missing the required parameter 'hash' when calling ComponentApi.get_component_by_hash" end # resource path local_var_path = '/v1/component/hash/{hash}'.sub('{' + 'hash' + '}', CGI.escape(hash.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] || 'Component' # 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: ComponentApi#get_component_by_hash\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Returns a specific component @param uuid [String] The UUID of the component to retrieve @param [Hash] opts the optional parameters @return [Component]
# File lib/dependency-tracker-client/api/component_api.rb, line 256 def get_component_by_uuid(uuid, opts = {}) data, _status_code, _headers = get_component_by_uuid_with_http_info(uuid, opts) data end
Returns a specific component @param uuid [String] The UUID of the component to retrieve @param [Hash] opts the optional parameters @return [Array<(Component
, Integer, Hash)>] Component
data, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 265 def get_component_by_uuid_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.get_component_by_uuid ...' 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 ComponentApi.get_component_by_uuid" end # resource path local_var_path = '/v1/component/{uuid}'.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] || 'Component' # 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: ComponentApi#get_component_by_uuid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Requests the identification of internal components in the portfolio @param [Hash] opts the optional parameters @return [nil]
# File lib/dependency-tracker-client/api/component_api.rb, line 315 def identify_internal_components(opts = {}) identify_internal_components_with_http_info(opts) nil end
Requests the identification of internal components in the portfolio @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 323 def identify_internal_components_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.identify_internal_components ...' end # resource path local_var_path = '/v1/component/internal/identify' # 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: ComponentApi#identify_internal_components\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Updates a component @param [Hash] opts the optional parameters @option opts [Component] :body @return [Component]
# File lib/dependency-tracker-client/api/component_api.rb, line 368 def update_component(opts = {}) data, _status_code, _headers = update_component_with_http_info(opts) data end
Updates a component @param [Hash] opts the optional parameters @option opts [Component] :body @return [Array<(Component
, Integer, Hash)>] Component
data, response status code and response headers
# File lib/dependency-tracker-client/api/component_api.rb, line 377 def update_component_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ComponentApi.update_component ...' end # resource path local_var_path = '/v1/component' # 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' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:return_type] || 'Component' # 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(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ComponentApi#update_component\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end