class DependencyTracker::ProjectApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

clone_project(opts = {}) click to toggle source

Clones a project @param [Hash] opts the optional parameters @option opts [CloneProjectRequest] :body @return [Project]

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

Clones a project @param [Hash] opts the optional parameters @option opts [CloneProjectRequest] :body @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 35
def clone_project_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.clone_project ...'
  end
  # resource path
  local_var_path = '/v1/project/clone'

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

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

Creates a new project If a parent project exists, the UUID of the parent project is required @param [Hash] opts the optional parameters @option opts [Project] :body @return [Project]

# File lib/dependency-tracker-client/api/project_api.rb, line 85
def create_project(opts = {})
  data, _status_code, _headers = create_project_with_http_info(opts)
  data
end
create_project_with_http_info(opts = {}) click to toggle source

Creates a new project If a parent project exists, the UUID of the parent project is required @param [Hash] opts the optional parameters @option opts [Project] :body @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 95
def create_project_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'
  end
  # resource path
  local_var_path = '/v1/project'

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

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

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

# File lib/dependency-tracker-client/api/project_api.rb, line 144
def delete_project(uuid, opts = {})
  delete_project_with_http_info(uuid, opts)
  nil
end
delete_project_with_http_info(uuid, opts = {}) click to toggle source

Deletes a project @param uuid [String] The UUID of the project 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/project_api.rb, line 153
def delete_project_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.delete_project ...'
  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 ProjectApi.delete_project"
  end
  # resource path
  local_var_path = '/v1/project/{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: ProjectApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_project(name, version, opts = {}) click to toggle source

Returns a specific project by its name and version @param name [String] The name of the project to query on @param version [String] The version of the project to query on @param [Hash] opts the optional parameters @return [Project]

# File lib/dependency-tracker-client/api/project_api.rb, line 203
def get_project(name, version, opts = {})
  data, _status_code, _headers = get_project_with_http_info(name, version, opts)
  data
end
get_project1(uuid, opts = {}) click to toggle source

Returns a specific project @param uuid [String] The UUID of the project to retrieve @param [Hash] opts the optional parameters @return [Project]

# File lib/dependency-tracker-client/api/project_api.rb, line 270
def get_project1(uuid, opts = {})
  data, _status_code, _headers = get_project1_with_http_info(uuid, opts)
  data
end
get_project1_with_http_info(uuid, opts = {}) click to toggle source

Returns a specific project @param uuid [String] The UUID of the project to retrieve @param [Hash] opts the optional parameters @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 279
def get_project1_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.get_project1 ...'
  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 ProjectApi.get_project1"
  end
  # resource path
  local_var_path = '/v1/project/{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] || 'Project' 

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

Returns a specific project by its name and version @param name [String] The name of the project to query on @param version [String] The version of the project to query on @param [Hash] opts the optional parameters @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 213
def get_project_with_http_info(name, version, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling ProjectApi.get_project"
  end
  # verify the required parameter 'version' is set
  if @api_client.config.client_side_validation && version.nil?
    fail ArgumentError, "Missing the required parameter 'version' when calling ProjectApi.get_project"
  end
  # resource path
  local_var_path = '/v1/project/lookup'

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

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

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

Returns a list of all projects @param [Hash] opts the optional parameters @option opts [String] :name The optional name of the project to query on @option opts [Boolean] :exclude_inactive Optionally excludes inactive projects from being returned @return [Array<Project>]

# File lib/dependency-tracker-client/api/project_api.rb, line 331
def get_projects(opts = {})
  data, _status_code, _headers = get_projects_with_http_info(opts)
  data
end
get_projects_by_tag(tag, opts = {}) click to toggle source

Returns a list of all projects by tag @param tag [String] The tag to query on @param [Hash] opts the optional parameters @return [Array<Project>]

# File lib/dependency-tracker-client/api/project_api.rb, line 390
def get_projects_by_tag(tag, opts = {})
  data, _status_code, _headers = get_projects_by_tag_with_http_info(tag, opts)
  data
end
get_projects_by_tag_with_http_info(tag, opts = {}) click to toggle source

Returns a list of all projects by tag @param tag [String] The tag to query on @param [Hash] opts the optional parameters @return [Array<(Array<Project>, Integer, Hash)>] Array<Project> data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 399
def get_projects_by_tag_with_http_info(tag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects_by_tag ...'
  end
  # verify the required parameter 'tag' is set
  if @api_client.config.client_side_validation && tag.nil?
    fail ArgumentError, "Missing the required parameter 'tag' when calling ProjectApi.get_projects_by_tag"
  end
  # resource path
  local_var_path = '/v1/project/tag/{tag}'.sub('{' + 'tag' + '}', CGI.escape(tag.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<Project>' 

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

Returns a list of all projects @param [Hash] opts the optional parameters @option opts [String] :name The optional name of the project to query on @option opts [Boolean] :exclude_inactive Optionally excludes inactive projects from being returned @return [Array<(Array<Project>, Integer, Hash)>] Array<Project> data, response status code and response headers

# File lib/dependency-tracker-client/api/project_api.rb, line 341
def get_projects_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...'
  end
  # resource path
  local_var_path = '/v1/project'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'excludeInactive'] = opts[:'exclude_inactive'] if !opts[:'exclude_inactive'].nil?

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

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

Updates a project @param [Hash] opts the optional parameters @option opts [Project] :body @return [Project]

# File lib/dependency-tracker-client/api/project_api.rb, line 450
def update_project(opts = {})
  data, _status_code, _headers = update_project_with_http_info(opts)
  data
end
update_project_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/project_api.rb, line 459
def update_project_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...'
  end
  # resource path
  local_var_path = '/v1/project'

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

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