Skip to content

Commit

Permalink
Expose user_starred_projects API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
liaden authored and joel-johnson-omada committed Sep 23, 2020
1 parent c6d7243 commit a49fd0c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/gitlab/client/projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,25 @@ def unstar_project(id)
delete("/projects/#{url_encode id}/star")
end

# Get a list of visible projects that the given user has starred.
# @see https://docs.gitlab.com/ee/api/projects.html#list-projects-starred-by-a-user
#
# @example
# Gitlab.user_starred_projects(1)
# Gitlab.user_starred_projects(1, { order_by: 'last_activity_at' })
# Gitlab.user_starred_projects('username', { order_by: 'name', sort: 'asc' })
#
# @param [Integer, String] user_id The ID or username of the user.
# @param [Hash] options A customizable set of options.
# @option options [String] :per_page Number of projects to return per page
# @option options [String] :page The page to retrieve
# @option options [String] :order_by Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields.
# @option options [String] :sort Return projects sorted in asc or desc order.
# @return [Array<Gitlab::ObjectifiedHash>]
def user_starred_projects(user_id, options = {})
get("/users/#{url_encode user_id}/starred_projects", query: options)
end

# Get a list of visible projects for the given user.
# @see https://docs.gitlab.com/ee/api/projects.html#list-user-projects
#
Expand Down

0 comments on commit a49fd0c

Please sign in to comment.