Module: Gitlab::Client::Projects
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/projects.rb
Overview
Defines methods related to projects.
Instance Method Summary collapse
-
#add_project_hook(project, url) ⇒ Gitlab::ObjectifiedHash
Adds a new hook to the project.
-
#add_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Adds a user to project team.
-
#create_project(name, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new project.
-
#delete_project_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a hook from project.
-
#edit_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Updates a team member’s project access level.
-
#project(id) ⇒ Gitlab::ObjectifiedHash
Gets information about a project.
-
#project_hooks(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project hooks.
-
#projects(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of projects owned by the authenticated user.
-
#remove_team_member(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Removes a user from project team.
-
#team_member(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a project team member.
-
#team_members(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project team members.
Instance Method Details
#add_project_hook(project, url) ⇒ Gitlab::ObjectifiedHash
Adds a new hook to the project.
139 140 141 |
# File 'lib/gitlab/client/projects.rb', line 139 def add_project_hook(project, url) post("/projects/#{project}/hooks", :body => {:url => url}) end |
#add_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Adds a user to project team.
87 88 89 |
# File 'lib/gitlab/client/projects.rb', line 87 def add_team_member(project, id, access_level) post("/projects/#{project}/members/#{id}", :body => {:access_level => access_level}) end |
#create_project(name, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new project.
47 48 49 |
# File 'lib/gitlab/client/projects.rb', line 47 def create_project(name, ={}) post("/projects", :body => {:name => name}.merge()) end |
#delete_project_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a hook from project.
151 152 153 |
# File 'lib/gitlab/client/projects.rb', line 151 def delete_project_hook(project, id) delete("/projects/#{project}/hooks/#{id}") end |
#edit_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Updates a team member’s project access level.
100 101 102 |
# File 'lib/gitlab/client/projects.rb', line 100 def edit_team_member(project, id, access_level) put("/projects/#{project}/members/#{id}", :body => {:access_level => access_level}) end |
#project(id) ⇒ Gitlab::ObjectifiedHash
Gets information about a project.
25 26 27 |
# File 'lib/gitlab/client/projects.rb', line 25 def project(id) get("/projects/#{id}") end |
#project_hooks(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project hooks.
127 128 129 |
# File 'lib/gitlab/client/projects.rb', line 127 def project_hooks(project, ={}) get("/projects/#{project}/hooks", :query => ) end |
#projects(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of projects owned by the authenticated user.
13 14 15 |
# File 'lib/gitlab/client/projects.rb', line 13 def projects(={}) get("/projects", :query => ) end |
#remove_team_member(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Removes a user from project team.
112 113 114 |
# File 'lib/gitlab/client/projects.rb', line 112 def remove_team_member(project, id) delete("/projects/#{project}/members/#{id}") end |
#team_member(project, id) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a project team member.
74 75 76 |
# File 'lib/gitlab/client/projects.rb', line 74 def team_member(project, id) get("/projects/#{project}/members/#{id}") end |
#team_members(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project team members.
62 63 64 |
# File 'lib/gitlab/client/projects.rb', line 62 def team_members(project, ={}) get("/projects/#{project}/members", :query => ) end |