Module: BacklogKit::Client::User

Included in:
BacklogKit::Client
Defined in:
lib/backlog_kit/client/user.rb

Overview

Methods for the User API

Instance Method Summary collapse

Instance Method Details

#create_user(params = {}) ⇒ BacklogKit::Response

Create a new user

Parameters:

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

    Request parameters

Returns:



24
25
26
# File 'lib/backlog_kit/client/user.rb', line 24

def create_user(params = {})
  post('users', params)
end

#delete_user(user_id) ⇒ BacklogKit::Response

Delete a user

Parameters:

  • user_id (Integer, String)

    User id

Returns:



41
42
43
# File 'lib/backlog_kit/client/user.rb', line 41

def delete_user(user_id)
  delete("users/#{user_id}")
end

#download_user_icon(user_id) ⇒ BacklogKit::Response

Download a user icon image

Parameters:

  • user_id (Integer, String)

    User id

Returns:



56
57
58
# File 'lib/backlog_kit/client/user.rb', line 56

def download_user_icon(user_id)
  get("users/#{user_id}/icon")
end

#get_myselfBacklogKit::Response

Get a authentication user

Returns:



48
49
50
# File 'lib/backlog_kit/client/user.rb', line 48

def get_myself
  get('users/myself')
end

#get_recently_viewed_issues(params = {}) ⇒ BacklogKit::Response

Get list of recently viewed issues

Parameters:

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

    Request parameters

Returns:



91
92
93
# File 'lib/backlog_kit/client/user.rb', line 91

def get_recently_viewed_issues(params = {})
  get('users/myself/recentlyViewedIssues', params)
end

#get_recently_viewed_projects(params = {}) ⇒ BacklogKit::Response

Get list of recently viewed projects

Parameters:

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

    Request parameters

Returns:



99
100
101
# File 'lib/backlog_kit/client/user.rb', line 99

def get_recently_viewed_projects(params = {})
  get('users/myself/recentlyViewedProjects', params)
end

#get_recently_viewed_wikis(params = {}) ⇒ BacklogKit::Response

Get list of recently viewed wiki pages

Parameters:

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

    Request parameters

Returns:



107
108
109
# File 'lib/backlog_kit/client/user.rb', line 107

def get_recently_viewed_wikis(params = {})
  get('users/myself/recentlyViewedWikis', params)
end

#get_user(user_id) ⇒ BacklogKit::Response

Get a user

Parameters:

  • user_id (Integer, String)

    User id

Returns:



16
17
18
# File 'lib/backlog_kit/client/user.rb', line 16

def get_user(user_id)
  get("users/#{user_id}")
end

#get_user_activities(user_id, params = {}) ⇒ BacklogKit::Response

Get list of user activities

Parameters:

  • user_id (Integer, String)

    User id

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

    Request parameters

Returns:



65
66
67
# File 'lib/backlog_kit/client/user.rb', line 65

def get_user_activities(user_id, params = {})
  get("users/#{user_id}/activities", params)
end

#get_user_star_count(user_id, params = {}) ⇒ BacklogKit::Response

Get number of user stars

Parameters:

  • user_id (Integer, String)

    User id

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

    Request parameters

Returns:



83
84
85
# File 'lib/backlog_kit/client/user.rb', line 83

def get_user_star_count(user_id, params = {})
  get("users/#{user_id}/stars/count", params)
end

#get_user_stars(user_id, params = {}) ⇒ BacklogKit::Response

Get list of user stars

Parameters:

  • user_id (Integer, String)

    User id

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

    Request parameters

Returns:



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

def get_user_stars(user_id, params = {})
  get("users/#{user_id}/stars", params)
end

#get_usersBacklogKit::Response

Get list of users

Returns:



8
9
10
# File 'lib/backlog_kit/client/user.rb', line 8

def get_users
  get('users')
end

#update_user(user_id, params = {}) ⇒ BacklogKit::Response

Update a user

Parameters:

  • user_id (Integer, String)

    User id

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

    Request parameters

Returns:



33
34
35
# File 'lib/backlog_kit/client/user.rb', line 33

def update_user(user_id, params = {})
  patch("users/#{user_id}", params)
end