Module: BWAPI::Client::User

Includes:
Facebook, InstagramCredentials, Notifications, Tokens, TwitterCredentials
Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/user.rb,
lib/bwapi/client/user/tokens.rb,
lib/bwapi/client/user/facebook.rb,
lib/bwapi/client/user/notifications.rb,
lib/bwapi/client/user/twitter_credentials.rb,
lib/bwapi/client/user/instagram_credentials.rb

Overview

User module for user endpoints and helper methods

Defined Under Namespace

Modules: Facebook, InstagramCredentials, Notifications, Tokens, TwitterCredentials

Instance Method Summary collapse

Methods included from TwitterCredentials

#delete_twitter_credentials, #twitter_credentials, #update_twitter_credentials

Methods included from Tokens

#delete_user_token, #user_tokens

Methods included from Notifications

#create_notification, #notifications, #patch_notification, #update_notification

Methods included from InstagramCredentials

#delete_instagram_credentials, #instagram_credentials, #update_instagram_credentials

Methods included from Facebook

#facebook_issues

Instance Method Details

#api_roleString

Get users api role

Returns:

  • (String)

    Users api role



103
104
105
# File 'lib/bwapi/client/user.rb', line 103

def api_role
  user.apiRole
end

#change_password(opts = {}) ⇒ Object

Change password

TODO: Add parameters documentation



47
48
49
# File 'lib/bwapi/client/user.rb', line 47

def change_password(opts = {})
  put '/user/changePassword', opts
end

#enable_two_factor_auth(opts = {}) ⇒ Object

Enable 2FA for current user

TODO: Add parameters documentation



75
76
77
# File 'lib/bwapi/client/user.rb', line 75

def enable_two_factor_auth(opts = {})
  post '/user/enableTwoFactorAuth', opts
end

#generate_two_factor_auth(opts = {}) ⇒ Object

Generate 2FA key for the current user

TODO: Add parameters documentation



68
69
70
# File 'lib/bwapi/client/user.rb', line 68

def generate_two_factor_auth(opts = {})
  post '/user/generateTwoFactorAuthKey', opts
end

#reset_password(opts = {}) ⇒ Object

Reset password for user

TODO: Add parameters documentation



54
55
56
# File 'lib/bwapi/client/user.rb', line 54

def reset_password(opts = {})
  post '/user/resetPassword', opts
end

#send_code(opts = {}) ⇒ Object

Send authentication code

TODO: Add parameters documentation



89
90
91
# File 'lib/bwapi/client/user.rb', line 89

def send_code(opts = {})
  post '/user/sendCode', opts
end

#send_reset_password_email(opts = {}) ⇒ Object

Send reset password email

TODO: Add parameters documentation



61
62
63
# File 'lib/bwapi/client/user.rb', line 61

def send_reset_password_email(opts = {})
  post '/user/sendResetPasswordEmail', opts
end

#ui_roleString

Get users ui role

Returns:

  • (String)

    Users ui role



110
111
112
# File 'lib/bwapi/client/user.rb', line 110

def ui_role
  user.uiRole
end

#update_user(opts = {}) ⇒ Hash

Update the current user

Parameters:

  • opts (Hash) (defaults to: {})

    options Hash of parameters

Options Hash (opts):

  • id (Integer)

    Id of the user

  • tags (Hash)

    The users assigned tags

  • passwordConfirmation (String)

    The confirmed password

  • enabled (Boolean)

    The status of the user

  • lastName (String)

    The last name of the user

  • phone (String)

    The users phone number

  • department (String)

    The users department

  • job (String)

    The users job

  • messenger (String)

    The users IM details

  • password (String)

    The password of the user

  • clientId (Integer)

    The users client id

  • username (String)

    The users username

  • address (String)

    The users address

  • uiRole (String)

    The users ui role

  • apiRole (Array)

    The users api role

  • firstName (String)

    The users first name

  • mobile (String)

    The users mobile number

  • creationDate (Date)

    Date the user was created on

Returns:

  • (Hash)

    Updated user information



40
41
42
# File 'lib/bwapi/client/user.rb', line 40

def update_user(opts = {})
  put 'user', opts
end

#userHash

Get the current user

Returns:

  • (Hash)

    User information



14
15
16
# File 'lib/bwapi/client/user.rb', line 14

def user
  get 'user'
end

#user_spredfastObject

Get Spredfast integration for current user

TODO: Add parameters documentation



96
97
98
# File 'lib/bwapi/client/user.rb', line 96

def user_spredfast
  get '/user/spredfast'
end

#verify_code(opts = {}) ⇒ Object

Verify OTP code

TODO: Add parameters documentation



82
83
84
# File 'lib/bwapi/client/user.rb', line 82

def verify_code(opts = {})
  get '/user/verifyCode', opts
end