class DependencyTracker::UserApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

add_team_to_user(username, body, opts = {}) click to toggle source

Adds the username to the specified team. @param username [String] A valid username @param body [IdentifiableObject] The UUID of the team to associate username with @param [Hash] opts the optional parameters @return [UserPrincipal]

# File lib/dependency-tracker-client/api/user_api.rb, line 27
def add_team_to_user(username, body, opts = {})
  data, _status_code, _headers = add_team_to_user_with_http_info(username, body, opts)
  data
end
add_team_to_user_with_http_info(username, body, opts = {}) click to toggle source

Adds the username to the specified team. @param username [String] A valid username @param body [IdentifiableObject] The UUID of the team to associate username with @param [Hash] opts the optional parameters @return [Array<(UserPrincipal, Integer, Hash)>] UserPrincipal data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 37
def add_team_to_user_with_http_info(username, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.add_team_to_user ...'
  end
  # verify the required parameter 'username' is set
  if @api_client.config.client_side_validation && username.nil?
    fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.add_team_to_user"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.add_team_to_user"
  end
  # resource path
  local_var_path = '/v1/user/{username}/membership'.sub('{' + 'username' + '}', CGI.escape(username.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'])
  # 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(body) 

  # return_type
  return_type = opts[:return_type] || 'UserPrincipal' 

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

Creates a new user that references an existing LDAP object. @param [Hash] opts the optional parameters @option opts [LdapUser] :body @return [LdapUser]

# File lib/dependency-tracker-client/api/user_api.rb, line 94
def create_ldap_user(opts = {})
  data, _status_code, _headers = create_ldap_user_with_http_info(opts)
  data
end
create_ldap_user_with_http_info(opts = {}) click to toggle source

Creates a new user that references an existing LDAP object. @param [Hash] opts the optional parameters @option opts [LdapUser] :body @return [Array<(LdapUser, Integer, Hash)>] LdapUser data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 103
def create_ldap_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.create_ldap_user ...'
  end
  # resource path
  local_var_path = '/v1/user/ldap'

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

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

Creates a new user. @param [Hash] opts the optional parameters @option opts [ManagedUser] :body @return [ManagedUser]

# File lib/dependency-tracker-client/api/user_api.rb, line 152
def create_managed_user(opts = {})
  data, _status_code, _headers = create_managed_user_with_http_info(opts)
  data
end
create_managed_user_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 161
def create_managed_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.create_managed_user ...'
  end
  # resource path
  local_var_path = '/v1/user/managed'

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

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

Deletes a user. @param [Hash] opts the optional parameters @option opts [LdapUser] :body @return [nil]

# File lib/dependency-tracker-client/api/user_api.rb, line 210
def delete_ldap_user(opts = {})
  delete_ldap_user_with_http_info(opts)
  nil
end
delete_ldap_user_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 219
def delete_ldap_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.delete_ldap_user ...'
  end
  # resource path
  local_var_path = '/v1/user/ldap'

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

Deletes a user. @param [Hash] opts the optional parameters @option opts [ManagedUser] :body @return [nil]

# File lib/dependency-tracker-client/api/user_api.rb, line 266
def delete_managed_user(opts = {})
  delete_managed_user_with_http_info(opts)
  nil
end
delete_managed_user_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 275
def delete_managed_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.delete_managed_user ...'
  end
  # resource path
  local_var_path = '/v1/user/managed'

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

Asserts login credentials and upon successful authentication, verifies passwords match and changes users password Upon a successful login, a JSON Web Token will be returned in the response body. This functionality requires authentication to be enabled. @param [Hash] opts the optional parameters @option opts [String] :username @option opts [String] :password @option opts [String] :new_password @option opts [String] :confirm_password @return [String]

# File lib/dependency-tracker-client/api/user_api.rb, line 326
def force_change_password(opts = {})
  data, _status_code, _headers = force_change_password_with_http_info(opts)
  data
end
force_change_password_with_http_info(opts = {}) click to toggle source

Asserts login credentials and upon successful authentication, verifies passwords match and changes users password Upon a successful login, a JSON Web Token will be returned in the response body. This functionality requires authentication to be enabled. @param [Hash] opts the optional parameters @option opts [String] :username @option opts [String] :password @option opts [String] :new_password @option opts [String] :confirm_password @return [Array<(String, Integer, Hash)>] String data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 339
def force_change_password_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.force_change_password ...'
  end
  # resource path
  local_var_path = '/v1/user/forceChangePassword'

  # 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(['text/plain'])
  # 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['username'] = opts[:'username'] if !opts[:'username'].nil?
  form_params['password'] = opts[:'password'] if !opts[:'password'].nil?
  form_params['newPassword'] = opts[:'new_password'] if !opts[:'new_password'].nil?
  form_params['confirmPassword'] = opts[:'confirm_password'] if !opts[:'confirm_password'].nil?

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

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

Returns a list of all LDAP users @param [Hash] opts the optional parameters @return [Array<LdapUser>]

# File lib/dependency-tracker-client/api/user_api.rb, line 391
def get_ldap_users(opts = {})
  data, _status_code, _headers = get_ldap_users_with_http_info(opts)
  data
end
get_ldap_users_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 399
def get_ldap_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_ldap_users ...'
  end
  # resource path
  local_var_path = '/v1/user/ldap'

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

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

Returns a list of all managed users @param [Hash] opts the optional parameters @return [Array<ManagedUser>]

# File lib/dependency-tracker-client/api/user_api.rb, line 445
def get_managed_users(opts = {})
  data, _status_code, _headers = get_managed_users_with_http_info(opts)
  data
end
get_managed_users_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 453
def get_managed_users_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_managed_users ...'
  end
  # resource path
  local_var_path = '/v1/user/managed'

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

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

Returns information about the current logged in user. @param [Hash] opts the optional parameters @return [UserPrincipal]

# File lib/dependency-tracker-client/api/user_api.rb, line 499
def get_self(opts = {})
  data, _status_code, _headers = get_self_with_http_info(opts)
  data
end
get_self_with_http_info(opts = {}) click to toggle source

Returns information about the current logged in user. @param [Hash] opts the optional parameters @return [Array<(UserPrincipal, Integer, Hash)>] UserPrincipal data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 507
def get_self_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.get_self ...'
  end
  # resource path
  local_var_path = '/v1/user/self'

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

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

Removes the username from the specified team. @param username [String] A valid username @param body [IdentifiableObject] The UUID of the team to un-associate username from @param [Hash] opts the optional parameters @return [UserPrincipal]

# File lib/dependency-tracker-client/api/user_api.rb, line 555
def remove_team_from_user(username, body, opts = {})
  data, _status_code, _headers = remove_team_from_user_with_http_info(username, body, opts)
  data
end
remove_team_from_user_with_http_info(username, body, opts = {}) click to toggle source

Removes the username from the specified team. @param username [String] A valid username @param body [IdentifiableObject] The UUID of the team to un-associate username from @param [Hash] opts the optional parameters @return [Array<(UserPrincipal, Integer, Hash)>] UserPrincipal data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 565
def remove_team_from_user_with_http_info(username, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.remove_team_from_user ...'
  end
  # verify the required parameter 'username' is set
  if @api_client.config.client_side_validation && username.nil?
    fail ArgumentError, "Missing the required parameter 'username' when calling UserApi.remove_team_from_user"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling UserApi.remove_team_from_user"
  end
  # resource path
  local_var_path = '/v1/user/{username}/membership'.sub('{' + 'username' + '}', CGI.escape(username.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'])
  # 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(body) 

  # return_type
  return_type = opts[:return_type] || 'UserPrincipal' 

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

Updates a managed user. @param [Hash] opts the optional parameters @option opts [ManagedUser] :body @return [ManagedUser]

# File lib/dependency-tracker-client/api/user_api.rb, line 622
def update_managed_user(opts = {})
  data, _status_code, _headers = update_managed_user_with_http_info(opts)
  data
end
update_managed_user_with_http_info(opts = {}) click to toggle source

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

# File lib/dependency-tracker-client/api/user_api.rb, line 631
def update_managed_user_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.update_managed_user ...'
  end
  # resource path
  local_var_path = '/v1/user/managed'

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

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

Updates information about the current logged in user. @param [Hash] opts the optional parameters @option opts [ManagedUser] :body @return [UserPrincipal]

# File lib/dependency-tracker-client/api/user_api.rb, line 680
def update_self(opts = {})
  data, _status_code, _headers = update_self_with_http_info(opts)
  data
end
update_self_with_http_info(opts = {}) click to toggle source

Updates information about the current logged in user. @param [Hash] opts the optional parameters @option opts [ManagedUser] :body @return [Array<(UserPrincipal, Integer, Hash)>] UserPrincipal data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 689
def update_self_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.update_self ...'
  end
  # resource path
  local_var_path = '/v1/user/self'

  # 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] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'UserPrincipal' 

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

Assert login credentials Upon a successful login, a JSON Web Token will be returned in the response body. This functionality requires authentication to be enabled. @param [Hash] opts the optional parameters @option opts [String] :username @option opts [String] :password @return [String]

# File lib/dependency-tracker-client/api/user_api.rb, line 738
def validate_credentials(opts = {})
  data, _status_code, _headers = validate_credentials_with_http_info(opts)
  data
end
validate_credentials_with_http_info(opts = {}) click to toggle source

Assert login credentials Upon a successful login, a JSON Web Token will be returned in the response body. This functionality requires authentication to be enabled. @param [Hash] opts the optional parameters @option opts [String] :username @option opts [String] :password @return [Array<(String, Integer, Hash)>] String data, response status code and response headers

# File lib/dependency-tracker-client/api/user_api.rb, line 749
def validate_credentials_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UserApi.validate_credentials ...'
  end
  # resource path
  local_var_path = '/v1/user/login'

  # 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(['text/plain'])
  # 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['username'] = opts[:'username'] if !opts[:'username'].nil?
  form_params['password'] = opts[:'password'] if !opts[:'password'].nil?

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'String' 

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