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) ⇒ Gitlab::ObjectifiedHash
Adds a user to project team.
-
#create_deploy_key(project, title, key) ⇒ Gitlab::ObjectifiedHash
Creates a new deploy key.
-
#create_project(name, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new project.
-
#delete_deploy_key(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a deploy key from project.
-
#delete_project_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a hook from project.
-
#deploy_key(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single project deploy key.
-
#deploy_keys(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a project deploy keys.
-
#edit_project_hook(project, id, url) ⇒ Gitlab::ObjectifiedHash
Updates a project hook URL.
-
#edit_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Updates a team member’s project access level.
-
#make_forked_from(project, id) ⇒ Gitlab::ObjectifiedHash
Mark this project as forked from the other.
-
#project(id) ⇒ Gitlab::ObjectifiedHash
Gets information about a project.
-
#project_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a project hook.
-
#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_forked(project) ⇒ Gitlab::ObjectifiedHash
Remove a forked_from relationship for a project.
-
#remove_team_member(project, id) ⇒ Gitlab::ObjectifiedHash
Removes a user from project team.
-
#team_member(project, id) ⇒ 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.
158 159 160 |
# File 'lib/gitlab/client/projects.rb', line 158 def add_project_hook(project, url) post("/projects/#{project}/hooks", :body => {:url => url}) end |
#add_team_member(project, id, access_level) ⇒ Gitlab::ObjectifiedHash
Adds a user to project team.
91 92 93 |
# File 'lib/gitlab/client/projects.rb', line 91 def add_team_member(project, id, access_level) post("/projects/#{project}/members", :body => {:user_id => id, :access_level => access_level}) end |
#create_deploy_key(project, title, key) ⇒ Gitlab::ObjectifiedHash
Creates a new deploy key.
246 247 248 |
# File 'lib/gitlab/client/projects.rb', line 246 def create_deploy_key(project, title, key) post("/projects/#{project}/keys", title: title, key: key) end |
#create_project(name, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new project.
48 49 50 51 |
# File 'lib/gitlab/client/projects.rb', line 48 def create_project(name, ={}) url = [:user_id] ? "/projects/user/#{options[:user_id]}" : "/projects" post(url, :body => {:name => name}.merge()) end |
#delete_deploy_key(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a deploy key from project.
258 259 260 |
# File 'lib/gitlab/client/projects.rb', line 258 def delete_deploy_key(project, id) delete("/projects/#{project}/keys/#{id}") end |
#delete_project_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Deletes a hook from project.
183 184 185 |
# File 'lib/gitlab/client/projects.rb', line 183 def delete_project_hook(project, id) delete("/projects/#{project}/hooks/#{id}") end |
#deploy_key(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a single project deploy key.
233 234 235 |
# File 'lib/gitlab/client/projects.rb', line 233 def deploy_key(project, id) get("/projects/#{project}/keys/#{id}") end |
#deploy_keys(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a project deploy keys.
221 222 223 |
# File 'lib/gitlab/client/projects.rb', line 221 def deploy_keys(project, ={}) get("/projects/#{project}/keys", :query => ) end |
#edit_project_hook(project, id, url) ⇒ Gitlab::ObjectifiedHash
Updates a project hook URL.
171 172 173 |
# File 'lib/gitlab/client/projects.rb', line 171 def edit_project_hook(project, id, url) put("/projects/#{project}/hooks/#{id}", :body => {:url => url}) end |
#edit_team_member(project, id, access_level) ⇒ Array<Gitlab::ObjectifiedHash>
Updates a team member’s project access level.
105 106 107 |
# File 'lib/gitlab/client/projects.rb', line 105 def edit_team_member(project, id, access_level) put("/projects/#{project}/members/#{id}", :body => {:access_level => access_level}) end |
#make_forked_from(project, id) ⇒ Gitlab::ObjectifiedHash
Mark this project as forked from the other
195 196 197 |
# File 'lib/gitlab/client/projects.rb', line 195 def make_forked_from(project, id) post("/projects/#{project}/fork/#{id}") 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_hook(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a project hook.
146 147 148 |
# File 'lib/gitlab/client/projects.rb', line 146 def project_hook(project, id) get("/projects/#{project}/hooks/#{id}") end |
#project_hooks(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project hooks.
133 134 135 |
# File 'lib/gitlab/client/projects.rb', line 133 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_forked(project) ⇒ Gitlab::ObjectifiedHash
Remove a forked_from relationship for a project.
207 208 209 |
# File 'lib/gitlab/client/projects.rb', line 207 def remove_forked(project) delete("/projects/#{project}/fork") end |
#remove_team_member(project, id) ⇒ Gitlab::ObjectifiedHash
Removes a user from project team.
118 119 120 |
# File 'lib/gitlab/client/projects.rb', line 118 def remove_team_member(project, id) delete("/projects/#{project}/members/#{id}") end |
#team_member(project, id) ⇒ Gitlab::ObjectifiedHash
Gets a project team member.
77 78 79 |
# File 'lib/gitlab/client/projects.rb', line 77 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.
65 66 67 |
# File 'lib/gitlab/client/projects.rb', line 65 def team_members(project, ={}) get("/projects/#{project}/members", :query => ) end |