class DependencyTracker::DefaultApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_project_to_rule(rule_uuid, project_uuid, opts = {}) click to toggle source

Adds a project to a notification rule @param rule_uuid [String] The UUID of the rule to add a project to @param project_uuid [String] The UUID of the project to add to the rule @param [Hash] opts the optional parameters @return [NotificationRule]

# File lib/dependency-tracker-client/api/default_api.rb, line 27
def add_project_to_rule(rule_uuid, project_uuid, opts = {})
  data, _status_code, _headers = add_project_to_rule_with_http_info(rule_uuid, project_uuid, opts)
  data
end
add_project_to_rule_with_http_info(rule_uuid, project_uuid, opts = {}) click to toggle source

Adds a project to a notification rule @param rule_uuid [String] The UUID of the rule to add a project to @param project_uuid [String] The UUID of the project to add to the rule @param [Hash] opts the optional parameters @return [Array<(NotificationRule, Integer, Hash)>] NotificationRule data, response status code and response headers

# File lib/dependency-tracker-client/api/default_api.rb, line 37
def add_project_to_rule_with_http_info(rule_uuid, project_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.add_project_to_rule ...'
  end
  # verify the required parameter 'rule_uuid' is set
  if @api_client.config.client_side_validation && rule_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'rule_uuid' when calling DefaultApi.add_project_to_rule"
  end
  # verify the required parameter 'project_uuid' is set
  if @api_client.config.client_side_validation && project_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'project_uuid' when calling DefaultApi.add_project_to_rule"
  end
  # resource path
  local_var_path = '/v1/notification/rule/{ruleUuid}/project/{projectUuid}'.sub('{' + 'ruleUuid' + '}', CGI.escape(rule_uuid.to_s)).sub('{' + 'projectUuid' + '}', CGI.escape(project_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] || 'NotificationRule' 

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

Creates a new notification rule @param [Hash] opts the optional parameters @option opts [NotificationRule] :body @return [NotificationRule]

# File lib/dependency-tracker-client/api/default_api.rb, line 92
def create_notification_rule(opts = {})
  data, _status_code, _headers = create_notification_rule_with_http_info(opts)
  data
end
create_notification_rule_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/default_api.rb, line 101
def create_notification_rule_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification_rule ...'
  end
  # resource path
  local_var_path = '/v1/notification/rule'

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

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

Deletes a notification rule @param [Hash] opts the optional parameters @option opts [NotificationRule] :body @return [nil]

# File lib/dependency-tracker-client/api/default_api.rb, line 150
def delete_notification_rule(opts = {})
  delete_notification_rule_with_http_info(opts)
  nil
end
delete_notification_rule_with_http_info(opts = {}) click to toggle source

Deletes a notification rule @param [Hash] opts the optional parameters @option opts [NotificationRule] :body @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/dependency-tracker-client/api/default_api.rb, line 159
def delete_notification_rule_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.delete_notification_rule ...'
  end
  # resource path
  local_var_path = '/v1/notification/rule'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # 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] 

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

Returns a list of all notification publishers @param [Hash] opts the optional parameters @return [Array<NotificationPublisher>]

# File lib/dependency-tracker-client/api/default_api.rb, line 205
def get_all_notification_publishers(opts = {})
  data, _status_code, _headers = get_all_notification_publishers_with_http_info(opts)
  data
end
get_all_notification_publishers_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/default_api.rb, line 213
def get_all_notification_publishers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_all_notification_publishers ...'
  end
  # resource path
  local_var_path = '/v1/notification/publisher'

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

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

Returns a list of all notification rules @param [Hash] opts the optional parameters @return [Array<NotificationRule>]

# File lib/dependency-tracker-client/api/default_api.rb, line 259
def get_all_notification_rules(opts = {})
  data, _status_code, _headers = get_all_notification_rules_with_http_info(opts)
  data
end
get_all_notification_rules_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/default_api.rb, line 267
def get_all_notification_rules_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_all_notification_rules ...'
  end
  # resource path
  local_var_path = '/v1/notification/rule'

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

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

Removes a project from a notification rule @param rule_uuid [String] The UUID of the rule to remove the project from @param project_uuid [String] The UUID of the project to remove from the rule @param [Hash] opts the optional parameters @return [NotificationRule]

# File lib/dependency-tracker-client/api/default_api.rb, line 315
def remove_project_from_rule(rule_uuid, project_uuid, opts = {})
  data, _status_code, _headers = remove_project_from_rule_with_http_info(rule_uuid, project_uuid, opts)
  data
end
remove_project_from_rule_with_http_info(rule_uuid, project_uuid, opts = {}) click to toggle source

Removes a project from a notification rule @param rule_uuid [String] The UUID of the rule to remove the project from @param project_uuid [String] The UUID of the project to remove from the rule @param [Hash] opts the optional parameters @return [Array<(NotificationRule, Integer, Hash)>] NotificationRule data, response status code and response headers

# File lib/dependency-tracker-client/api/default_api.rb, line 325
def remove_project_from_rule_with_http_info(rule_uuid, project_uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.remove_project_from_rule ...'
  end
  # verify the required parameter 'rule_uuid' is set
  if @api_client.config.client_side_validation && rule_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'rule_uuid' when calling DefaultApi.remove_project_from_rule"
  end
  # verify the required parameter 'project_uuid' is set
  if @api_client.config.client_side_validation && project_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'project_uuid' when calling DefaultApi.remove_project_from_rule"
  end
  # resource path
  local_var_path = '/v1/notification/rule/{ruleUuid}/project/{projectUuid}'.sub('{' + 'ruleUuid' + '}', CGI.escape(rule_uuid.to_s)).sub('{' + 'projectUuid' + '}', CGI.escape(project_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] || 'NotificationRule' 

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

Dispatches a SMTP notification test @param [Hash] opts the optional parameters @option opts [String] :destination @return [nil]

# File lib/dependency-tracker-client/api/default_api.rb, line 380
def test_smtp_publisher_config(opts = {})
  test_smtp_publisher_config_with_http_info(opts)
  nil
end
test_smtp_publisher_config_with_http_info(opts = {}) click to toggle source

Dispatches a SMTP notification test @param [Hash] opts the optional parameters @option opts [String] :destination @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/dependency-tracker-client/api/default_api.rb, line 389
def test_smtp_publisher_config_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.test_smtp_publisher_config ...'
  end
  # resource path
  local_var_path = '/v1/notification/publisher/test/smtp'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['destination'] = opts[:'destination'] if !opts[:'destination'].nil?

  # 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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#test_smtp_publisher_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_notification_rule(opts = {}) click to toggle source

Updates a notification rule @param [Hash] opts the optional parameters @option opts [NotificationRule] :body @return [NotificationRule]

# File lib/dependency-tracker-client/api/default_api.rb, line 437
def update_notification_rule(opts = {})
  data, _status_code, _headers = update_notification_rule_with_http_info(opts)
  data
end
update_notification_rule_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/default_api.rb, line 446
def update_notification_rule_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update_notification_rule ...'
  end
  # resource path
  local_var_path = '/v1/notification/rule'

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

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