module BWAPI::Client::User

User module for user endpoints and helper methods

Public Instance Methods

api_role() click to toggle source

Get users api role

@return [String] Users api role

# File lib/bwapi/client/user.rb, line 102
def api_role
  user.apiRole
end
change_password(opts = {}) click to toggle source

Change password

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 46
def change_password(opts = {})
  put '/user/changePassword', opts
end
enable_two_factor_auth(opts = {}) click to toggle source

Enable 2FA for current user

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 74
def enable_two_factor_auth(opts = {})
  post '/user/enableTwoFactorAuth', opts
end
generate_two_factor_auth(opts = {}) click to toggle source

Generate 2FA key for the current user

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 67
def generate_two_factor_auth(opts = {})
  post '/user/generateTwoFactorAuthKey', opts
end
reset_password(opts = {}) click to toggle source

Reset password for user

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 53
def reset_password(opts = {})
  post '/user/resetPassword', opts
end
send_code(opts = {}) click to toggle source

Send authentication code

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 88
def send_code(opts = {})
  post '/user/sendCode', opts
end
send_reset_password_email(opts = {}) click to toggle source

Send reset password email

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 60
def send_reset_password_email(opts = {})
  post '/user/sendResetPasswordEmail', opts
end
ui_role() click to toggle source

Get users ui role

@return [String] Users ui role

# File lib/bwapi/client/user.rb, line 109
def ui_role
  user.uiRole
end
update_user(opts = {}) click to toggle source

Update the current user

@param opts [Hash] options Hash of parameters @option opts [Integer] id Id of the user @option opts [Hash] tags The users assigned tags @option opts [String] passwordConfirmation The confirmed password @option opts [Boolean] enabled The status of the user @option opts [String] lastName The last name of the user @option opts [String] phone The users phone number @option opts [String] department The users department @option opts [String] job The users job @option opts [String] messenger The users IM details @option opts [String] password The password of the user @option opts [Integer] clientId The users client id @option opts [String] username The users username @option opts [String] address The users address @option opts [String] uiRole The users ui role @option opts [Array] apiRole The users api role @option opts [String] firstName The users first name @option opts [String] mobile The users mobile number @option opts [Date] creationDate Date the user was created on @return [Hash] Updated user information

# File lib/bwapi/client/user.rb, line 39
def update_user(opts = {})
  put 'user', opts
end
user() click to toggle source

Get the current user

@return [Hash] User information

# File lib/bwapi/client/user.rb, line 13
def user
  get 'user'
end
user_spredfast() click to toggle source

Get Spredfast integration for current user

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 95
def user_spredfast
  get '/user/spredfast'
end
verify_code(opts = {}) click to toggle source

Verify OTP code

TODO: Add parameters documentation

# File lib/bwapi/client/user.rb, line 81
def verify_code(opts = {})
  get '/user/verifyCode', opts
end