class DependencyTracker::RepositoryApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/dependency-tracker-client/api/repository_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_repository(opts = {}) click to toggle source

Creates a new repository @param [Hash] opts the optional parameters @option opts [Repository] :body @return [Repository]

# File lib/dependency-tracker-client/api/repository_api.rb, line 26
def create_repository(opts = {})
  data, _status_code, _headers = create_repository_with_http_info(opts)
  data
end
create_repository_with_http_info(opts = {}) click to toggle source

Creates a new repository @param [Hash] opts the optional parameters @option opts [Repository] :body @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers

# File lib/dependency-tracker-client/api/repository_api.rb, line 35
def create_repository_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.create_repository ...'
  end
  # resource path
  local_var_path = '/v1/repository'

  # 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] || 'Repository' 

  # 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: RepositoryApi#create_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_repository(uuid, opts = {}) click to toggle source

Deletes a repository @param uuid [String] The UUID of the repository to delete @param [Hash] opts the optional parameters @return [nil]

# File lib/dependency-tracker-client/api/repository_api.rb, line 84
def delete_repository(uuid, opts = {})
  delete_repository_with_http_info(uuid, opts)
  nil
end
delete_repository_with_http_info(uuid, opts = {}) click to toggle source

Deletes a repository @param uuid [String] The UUID of the repository 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/repository_api.rb, line 93
def delete_repository_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.delete_repository ...'
  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 RepositoryApi.delete_repository"
  end
  # resource path
  local_var_path = '/v1/repository/{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: RepositoryApi#delete_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_repositories(opts = {}) click to toggle source

Returns a list of all repositories @param [Hash] opts the optional parameters @return [Array<Repository>]

# File lib/dependency-tracker-client/api/repository_api.rb, line 141
def get_repositories(opts = {})
  data, _status_code, _headers = get_repositories_with_http_info(opts)
  data
end
get_repositories_by_type(type, opts = {}) click to toggle source

Returns repositories that support the specific type @param type [String] The type of repositories to retrieve @param [Hash] opts the optional parameters @return [Array<Repository>]

# File lib/dependency-tracker-client/api/repository_api.rb, line 196
def get_repositories_by_type(type, opts = {})
  data, _status_code, _headers = get_repositories_by_type_with_http_info(type, opts)
  data
end
get_repositories_by_type_with_http_info(type, opts = {}) click to toggle source

Returns repositories that support the specific type @param type [String] The type of repositories to retrieve @param [Hash] opts the optional parameters @return [Array<(Array<Repository>, Integer, Hash)>] Array<Repository> data, response status code and response headers

# File lib/dependency-tracker-client/api/repository_api.rb, line 205
def get_repositories_by_type_with_http_info(type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.get_repositories_by_type ...'
  end
  # verify the required parameter 'type' is set
  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling RepositoryApi.get_repositories_by_type"
  end
  # verify enum value
  allowable_values = ["MAVEN", "NPM", "GEM", "PYPI", "NUGET", "HEX", "UNSUPPORTED"]
  if @api_client.config.client_side_validation && !allowable_values.include?(type)
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/repository/{type}'.sub('{' + 'type' + '}', CGI.escape(type.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] || 'Array<Repository>' 

  # 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: RepositoryApi#get_repositories_by_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_repositories_with_http_info(opts = {}) click to toggle source

Returns a list of all repositories @param [Hash] opts the optional parameters @return [Array<(Array<Repository>, Integer, Hash)>] Array<Repository> data, response status code and response headers

# File lib/dependency-tracker-client/api/repository_api.rb, line 149
def get_repositories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.get_repositories ...'
  end
  # resource path
  local_var_path = '/v1/repository'

  # 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<Repository>' 

  # 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: RepositoryApi#get_repositories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_repository_meta_component(purl, opts = {}) click to toggle source

Attempts to resolve the latest version of the component available in the configured repositories @param purl [String] The Package URL for the component to query @param [Hash] opts the optional parameters @return [RepositoryMetaComponent]

# File lib/dependency-tracker-client/api/repository_api.rb, line 261
def get_repository_meta_component(purl, opts = {})
  data, _status_code, _headers = get_repository_meta_component_with_http_info(purl, opts)
  data
end
get_repository_meta_component_with_http_info(purl, opts = {}) click to toggle source

Attempts to resolve the latest version of the component available in the configured repositories @param purl [String] The Package URL for the component to query @param [Hash] opts the optional parameters @return [Array<(RepositoryMetaComponent, Integer, Hash)>] RepositoryMetaComponent data, response status code and response headers

# File lib/dependency-tracker-client/api/repository_api.rb, line 270
def get_repository_meta_component_with_http_info(purl, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.get_repository_meta_component ...'
  end
  # verify the required parameter 'purl' is set
  if @api_client.config.client_side_validation && purl.nil?
    fail ArgumentError, "Missing the required parameter 'purl' when calling RepositoryApi.get_repository_meta_component"
  end
  # resource path
  local_var_path = '/v1/repository/latest'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'purl'] = purl

  # 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] || 'RepositoryMetaComponent' 

  # 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: RepositoryApi#get_repository_meta_component\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_repository(opts = {}) click to toggle source

Updates a repository @param [Hash] opts the optional parameters @option opts [Repository] :body @return [Repository]

# File lib/dependency-tracker-client/api/repository_api.rb, line 322
def update_repository(opts = {})
  data, _status_code, _headers = update_repository_with_http_info(opts)
  data
end
update_repository_with_http_info(opts = {}) click to toggle source

Updates a repository @param [Hash] opts the optional parameters @option opts [Repository] :body @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers

# File lib/dependency-tracker-client/api/repository_api.rb, line 331
def update_repository_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RepositoryApi.update_repository ...'
  end
  # resource path
  local_var_path = '/v1/repository'

  # 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] || 'Repository' 

  # 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: RepositoryApi#update_repository\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end