Module: BWAPI::Client::User

Includes:
Facebook, InstagramCredentials, Notifications, TwitterCredentials
Included in:
BWAPI::Client
Defined in:
lib/bwapi/client/user.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, TwitterCredentials

Instance Method Summary collapse

Methods included from TwitterCredentials

#delete_twitter_credentials, #twitter_credentials, #update_twitter_credentials

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



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

def api_role
  user.apiRole
end

#change_password(opts = {}) ⇒ Object

Change password

TODO: Add parameters documentation



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

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

#enable_two_factor_auth(opts = {}) ⇒ Object

Enable 2FA for current user

TODO: Add parameters documentation



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

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



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

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

#reset_password(opts = {}) ⇒ Object

Reset password for user

TODO: Add parameters documentation



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

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

#send_code(opts = {}) ⇒ Object

Send authentication code

TODO: Add parameters documentation



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

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

#send_reset_password_email(opts = {}) ⇒ Object

Send reset password email

TODO: Add parameters documentation



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

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

#ui_roleString

Get users ui role

Returns:

  • (String)

    Users ui role



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

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



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

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

#userHash

Get the current user

Returns:

  • (Hash)

    User information



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

def user
  get 'user'
end

#user_spredfastObject

Get Spredfast integration for current user

TODO: Add parameters documentation



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

def user_spredfast
  get '/user/spredfast'
end

#verify_code(opts = {}) ⇒ Object

Verify OTP code

TODO: Add parameters documentation



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

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