Module: BacklogKit::Client::Project
- Included in:
- BacklogKit::Client
- Defined in:
- lib/backlog_kit/client/project.rb
Overview
Methods for the Project API
Instance Method Summary collapse
-
#add_category(project_id_or_key, name) ⇒ BacklogKit::Response
Add a category to a project.
-
#add_issue_type(project_id_or_key, name, color) ⇒ BacklogKit::Response
Add an issue type to a project.
-
#add_project_admin_auth(project_id_or_key, user_id) ⇒ BacklogKit::Response
Add Project Administrator role to a user.
-
#add_project_team(project_id_or_key, team_id) ⇒ BacklogKit::Response
Add a team to a project.
-
#add_project_user(project_id_or_key, user_id) ⇒ BacklogKit::Response
Add a user to a project.
-
#add_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) ⇒ BacklogKit::Response
Add a comment to a pull request.
-
#add_version(project_id_or_key, name, params = {}) ⇒ BacklogKit::Response
Add a version to a project.
-
#add_webhook(project_id_or_key, name, hook_url, params = {}) ⇒ BacklogKit::Response
Add a webhook to a project.
-
#create_project(key, name, params = {}) ⇒ BacklogKit::Response
Create a new project.
-
#create_pull_request(project_id_or_key, repository_id_or_name, params = {}) ⇒ BacklogKit::Response
Create a new pull request.
-
#delete_project(project_id_or_key) ⇒ BacklogKit::Response
Delete a project.
-
#download_project_icon(project_id_or_key) ⇒ BacklogKit::Response
Download a project icon image.
-
#download_pull_request_attachment(project_id_or_key, repository_id_or_name, pull_request_number, attachment_id) ⇒ BacklogKit::Response
Download an attachment file on pull request.
-
#download_shared_file(project_id_or_key, file_id) ⇒ BacklogKit::Response
Download a shared file.
-
#get_categories(project_id_or_key) ⇒ BacklogKit::Response
Get list of categories.
-
#get_issue_types(project_id_or_key) ⇒ BacklogKit::Response
Get list of issue types.
-
#get_project(project_id_or_key) ⇒ BacklogKit::Response
Get a project.
-
#get_project_activities(project_id_or_key, params = {}) ⇒ BacklogKit::Response
Get list of project activities.
-
#get_project_administrators(project_id_or_key) ⇒ BacklogKit::Response
Get list of users who has Project Administrator role.
-
#get_project_disk_usage(project_id_or_key) ⇒ BacklogKit::Response
Get disk usage.
-
#get_project_teams(project_id_or_key) ⇒ BacklogKit::Response
Get list of project teams.
-
#get_project_users(project_id_or_key) ⇒ BacklogKit::Response
Get list of project members.
-
#get_projects(params = {}) ⇒ BacklogKit::Response
Get list of projects.
-
#get_pull_request(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get a pull request.
-
#get_pull_request_attachments(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get list of attachment files on pull request.
-
#get_pull_request_comment_count(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get number of comments in pull request.
-
#get_pull_request_comments(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get list of comments in pull request.
-
#get_pull_request_count(project_id_or_key, repository_id_or_name) ⇒ BacklogKit::Response
Get number of pull requests.
-
#get_pull_requests(project_id_or_key, repository_id_or_name) ⇒ BacklogKit::Response
Get list of pull requests.
-
#get_shared_files(project_id_or_key, directory_path = '', params = {}) ⇒ BacklogKit::Response
Get list of shared files.
-
#get_versions(project_id_or_key) ⇒ BacklogKit::Response
Get list of versions.
-
#get_webhook(project_id_or_key, webhook_id) ⇒ BacklogKit::Response
Get a webhook.
-
#get_webhooks(project_id_or_key) ⇒ BacklogKit::Response
Get list of webhooks.
-
#remove_category(project_id_or_key, category_id) ⇒ BacklogKit::Response
Remove a category from project.
-
#remove_issue_type(project_id_or_key, type_id, substitute_type_id) ⇒ BacklogKit::Response
Remove an issue type from project.
-
#remove_project_admin_auth(project_id_or_key, user_id) ⇒ BacklogKit::Response
Remove Project Administrator role from user.
-
#remove_project_team(project_id_or_key, team_id) ⇒ BacklogKit::Response
Remove a team from project.
-
#remove_project_user(project_id_or_key, user_id) ⇒ BacklogKit::Response
Remove a user from project.
-
#remove_pull_request_attachment(project_id_or_key, repository_id_or_name, pull_request_number, attachment_id) ⇒ BacklogKit::Response
Remove an attachment file from pull request.
-
#remove_version(project_id_or_key, version_id) ⇒ BacklogKit::Response
Remove a version from project.
-
#remove_webhook(project_id_or_key, webhook_id) ⇒ BacklogKit::Response
Remove a webhook from project.
-
#update_category(project_id_or_key, category_id, name) ⇒ BacklogKit::Response
Update a category.
-
#update_issue_type(project_id_or_key, type_id, params = {}) ⇒ BacklogKit::Response
Update an issue type.
-
#update_project(project_id_or_key, params = {}) ⇒ BacklogKit::Response
Update a project.
-
#update_pull_request(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) ⇒ BacklogKit::Response
Update a pull request.
-
#update_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, comment_id, content) ⇒ BacklogKit::Response
Update a comment in pull request.
-
#update_version(project_id_or_key, version_id, params = {}) ⇒ BacklogKit::Response
Update a version.
-
#update_webhook(project_id_or_key, webhook_id, params = {}) ⇒ BacklogKit::Response
Update a webhook.
Instance Method Details
#add_category(project_id_or_key, name) ⇒ BacklogKit::Response
Add a category to a project
196 197 198 |
# File 'lib/backlog_kit/client/project.rb', line 196 def add_category(project_id_or_key, name) post("projects/#{project_id_or_key}/categories", name: name) end |
#add_issue_type(project_id_or_key, name, color) ⇒ BacklogKit::Response
Add an issue type to a project
159 160 161 |
# File 'lib/backlog_kit/client/project.rb', line 159 def add_issue_type(project_id_or_key, name, color) post("projects/#{project_id_or_key}/issueTypes", name: name, color: color) end |
#add_project_admin_auth(project_id_or_key, user_id) ⇒ BacklogKit::Response
Add Project Administrator role to a user
132 133 134 |
# File 'lib/backlog_kit/client/project.rb', line 132 def add_project_admin_auth(project_id_or_key, user_id) post("projects/#{project_id_or_key}/administrators", user_id: user_id) end |
#add_project_team(project_id_or_key, team_id) ⇒ BacklogKit::Response
Add a team to a project
80 81 82 |
# File 'lib/backlog_kit/client/project.rb', line 80 def add_project_team(project_id_or_key, team_id) post("projects/#{project_id_or_key}/teams", team_id: team_id) end |
#add_project_user(project_id_or_key, user_id) ⇒ BacklogKit::Response
Add a user to a project
106 107 108 |
# File 'lib/backlog_kit/client/project.rb', line 106 def add_project_user(project_id_or_key, user_id) post("projects/#{project_id_or_key}/users", user_id: user_id) end |
#add_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) ⇒ BacklogKit::Response
Add a comment to a pull request
409 410 411 |
# File 'lib/backlog_kit/client/project.rb', line 409 def add_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/comments", params) end |
#add_version(project_id_or_key, name, params = {}) ⇒ BacklogKit::Response
Add a version to a project
233 234 235 236 |
# File 'lib/backlog_kit/client/project.rb', line 233 def add_version(project_id_or_key, name, params = {}) params[:name] = name post("projects/#{project_id_or_key}/versions", params) end |
#add_webhook(project_id_or_key, name, hook_url, params = {}) ⇒ BacklogKit::Response
Add a webhook to a project
308 309 310 311 312 |
# File 'lib/backlog_kit/client/project.rb', line 308 def add_webhook(project_id_or_key, name, hook_url, params = {}) params[:name] = name params[:hook_url] = hook_url post("projects/#{project_id_or_key}/webhooks", params) end |
#create_project(key, name, params = {}) ⇒ BacklogKit::Response
Create a new project
27 28 29 30 31 |
# File 'lib/backlog_kit/client/project.rb', line 27 def create_project(key, name, params = {}) params[:key] = key params[:name] = name post('projects', params) end |
#create_pull_request(project_id_or_key, repository_id_or_name, params = {}) ⇒ BacklogKit::Response
Create a new pull request
367 368 369 |
# File 'lib/backlog_kit/client/project.rb', line 367 def create_pull_request(project_id_or_key, repository_id_or_name, params = {}) post("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests", params) end |
#delete_project(project_id_or_key) ⇒ BacklogKit::Response
Delete a project
46 47 48 |
# File 'lib/backlog_kit/client/project.rb', line 46 def delete_project(project_id_or_key) delete("projects/#{project_id_or_key}") end |
#download_project_icon(project_id_or_key) ⇒ BacklogKit::Response
Download a project icon image
54 55 56 |
# File 'lib/backlog_kit/client/project.rb', line 54 def download_project_icon(project_id_or_key) get("projects/#{project_id_or_key}/image") end |
#download_pull_request_attachment(project_id_or_key, repository_id_or_name, pull_request_number, attachment_id) ⇒ BacklogKit::Response
Download an attachment file on pull request
442 443 444 |
# File 'lib/backlog_kit/client/project.rb', line 442 def (project_id_or_key, repository_id_or_name, pull_request_number, ) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/attachments/#{}") end |
#download_shared_file(project_id_or_key, file_id) ⇒ BacklogKit::Response
Download a shared file
272 273 274 |
# File 'lib/backlog_kit/client/project.rb', line 272 def download_shared_file(project_id_or_key, file_id) get("projects/#{project_id_or_key}/files/#{file_id}") end |
#get_categories(project_id_or_key) ⇒ BacklogKit::Response
Get list of categories
187 188 189 |
# File 'lib/backlog_kit/client/project.rb', line 187 def get_categories(project_id_or_key) get("projects/#{project_id_or_key}/categories") end |
#get_issue_types(project_id_or_key) ⇒ BacklogKit::Response
Get list of issue types
149 150 151 |
# File 'lib/backlog_kit/client/project.rb', line 149 def get_issue_types(project_id_or_key) get("projects/#{project_id_or_key}/issueTypes") end |
#get_project(project_id_or_key) ⇒ BacklogKit::Response
Get a project
17 18 19 |
# File 'lib/backlog_kit/client/project.rb', line 17 def get_project(project_id_or_key) get("projects/#{project_id_or_key}") end |
#get_project_activities(project_id_or_key, params = {}) ⇒ BacklogKit::Response
Get list of project activities
63 64 65 |
# File 'lib/backlog_kit/client/project.rb', line 63 def get_project_activities(project_id_or_key, params = {}) get("projects/#{project_id_or_key}/activities", params) end |
#get_project_administrators(project_id_or_key) ⇒ BacklogKit::Response
Get list of users who has Project Administrator role
123 124 125 |
# File 'lib/backlog_kit/client/project.rb', line 123 def get_project_administrators(project_id_or_key) get("projects/#{project_id_or_key}/administrators") end |
#get_project_disk_usage(project_id_or_key) ⇒ BacklogKit::Response
Get disk usage
280 281 282 |
# File 'lib/backlog_kit/client/project.rb', line 280 def get_project_disk_usage(project_id_or_key) get("projects/#{project_id_or_key}/diskUsage") end |
#get_project_teams(project_id_or_key) ⇒ BacklogKit::Response
Get list of project teams
71 72 73 |
# File 'lib/backlog_kit/client/project.rb', line 71 def get_project_teams(project_id_or_key) get("projects/#{project_id_or_key}/teams") end |
#get_project_users(project_id_or_key) ⇒ BacklogKit::Response
Get list of project members
97 98 99 |
# File 'lib/backlog_kit/client/project.rb', line 97 def get_project_users(project_id_or_key) get("projects/#{project_id_or_key}/users") end |
#get_projects(params = {}) ⇒ BacklogKit::Response
Get list of projects
9 10 11 |
# File 'lib/backlog_kit/client/project.rb', line 9 def get_projects(params = {}) get('projects', params) end |
#get_pull_request(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get a pull request
357 358 359 |
# File 'lib/backlog_kit/client/project.rb', line 357 def get_pull_request(project_id_or_key, repository_id_or_name, pull_request_number) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}") end |
#get_pull_request_attachments(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get list of attachment files on pull request
431 432 433 |
# File 'lib/backlog_kit/client/project.rb', line 431 def (project_id_or_key, repository_id_or_name, pull_request_number) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/attachments") end |
#get_pull_request_comment_count(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get number of comments in pull request
398 399 400 |
# File 'lib/backlog_kit/client/project.rb', line 398 def get_pull_request_comment_count(project_id_or_key, repository_id_or_name, pull_request_number) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/comments/count") end |
#get_pull_request_comments(project_id_or_key, repository_id_or_name, pull_request_number) ⇒ BacklogKit::Response
Get list of comments in pull request
388 389 390 |
# File 'lib/backlog_kit/client/project.rb', line 388 def get_pull_request_comments(project_id_or_key, repository_id_or_name, pull_request_number) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/comments") end |
#get_pull_request_count(project_id_or_key, repository_id_or_name) ⇒ BacklogKit::Response
Get number of pull requests
347 348 349 |
# File 'lib/backlog_kit/client/project.rb', line 347 def get_pull_request_count(project_id_or_key, repository_id_or_name) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/count") end |
#get_pull_requests(project_id_or_key, repository_id_or_name) ⇒ BacklogKit::Response
Get list of pull requests
338 339 340 |
# File 'lib/backlog_kit/client/project.rb', line 338 def get_pull_requests(project_id_or_key, repository_id_or_name) get("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests") end |
#get_shared_files(project_id_or_key, directory_path = '', params = {}) ⇒ BacklogKit::Response
Get list of shared files
263 264 265 |
# File 'lib/backlog_kit/client/project.rb', line 263 def get_shared_files(project_id_or_key, directory_path = '', params = {}) get("projects/#{project_id_or_key}/files/metadata/#{directory_path}", params) end |
#get_versions(project_id_or_key) ⇒ BacklogKit::Response
Get list of versions
223 224 225 |
# File 'lib/backlog_kit/client/project.rb', line 223 def get_versions(project_id_or_key) get("projects/#{project_id_or_key}/versions") end |
#get_webhook(project_id_or_key, webhook_id) ⇒ BacklogKit::Response
Get a webhook
297 298 299 |
# File 'lib/backlog_kit/client/project.rb', line 297 def get_webhook(project_id_or_key, webhook_id) get("projects/#{project_id_or_key}/webhooks/#{webhook_id}") end |
#get_webhooks(project_id_or_key) ⇒ BacklogKit::Response
Get list of webhooks
288 289 290 |
# File 'lib/backlog_kit/client/project.rb', line 288 def get_webhooks(project_id_or_key) get("projects/#{project_id_or_key}/webhooks") end |
#remove_category(project_id_or_key, category_id) ⇒ BacklogKit::Response
Remove a category from project
215 216 217 |
# File 'lib/backlog_kit/client/project.rb', line 215 def remove_category(project_id_or_key, category_id) delete("projects/#{project_id_or_key}/categories/#{category_id}") end |
#remove_issue_type(project_id_or_key, type_id, substitute_type_id) ⇒ BacklogKit::Response
Remove an issue type from project
179 180 181 |
# File 'lib/backlog_kit/client/project.rb', line 179 def remove_issue_type(project_id_or_key, type_id, substitute_type_id) delete("projects/#{project_id_or_key}/issueTypes/#{type_id}", substitute_issue_type_id: substitute_type_id) end |
#remove_project_admin_auth(project_id_or_key, user_id) ⇒ BacklogKit::Response
Remove Project Administrator role from user
141 142 143 |
# File 'lib/backlog_kit/client/project.rb', line 141 def remove_project_admin_auth(project_id_or_key, user_id) delete("projects/#{project_id_or_key}/administrators", user_id: user_id) end |
#remove_project_team(project_id_or_key, team_id) ⇒ BacklogKit::Response
Remove a team from project
89 90 91 |
# File 'lib/backlog_kit/client/project.rb', line 89 def remove_project_team(project_id_or_key, team_id) delete("projects/#{project_id_or_key}/teams", team_id: team_id) end |
#remove_project_user(project_id_or_key, user_id) ⇒ BacklogKit::Response
Remove a user from project
115 116 117 |
# File 'lib/backlog_kit/client/project.rb', line 115 def remove_project_user(project_id_or_key, user_id) delete("projects/#{project_id_or_key}/users", user_id: user_id) end |
#remove_pull_request_attachment(project_id_or_key, repository_id_or_name, pull_request_number, attachment_id) ⇒ BacklogKit::Response
Remove an attachment file from pull request
453 454 455 |
# File 'lib/backlog_kit/client/project.rb', line 453 def (project_id_or_key, repository_id_or_name, pull_request_number, ) delete("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/attachments/#{}") end |
#remove_version(project_id_or_key, version_id) ⇒ BacklogKit::Response
Remove a version from project
253 254 255 |
# File 'lib/backlog_kit/client/project.rb', line 253 def remove_version(project_id_or_key, version_id) delete("projects/#{project_id_or_key}/versions/#{version_id}") end |
#remove_webhook(project_id_or_key, webhook_id) ⇒ BacklogKit::Response
Remove a webhook from project
329 330 331 |
# File 'lib/backlog_kit/client/project.rb', line 329 def remove_webhook(project_id_or_key, webhook_id) delete("projects/#{project_id_or_key}/webhooks/#{webhook_id}") end |
#update_category(project_id_or_key, category_id, name) ⇒ BacklogKit::Response
Update a category
206 207 208 |
# File 'lib/backlog_kit/client/project.rb', line 206 def update_category(project_id_or_key, category_id, name) patch("projects/#{project_id_or_key}/categories/#{category_id}", name: name) end |
#update_issue_type(project_id_or_key, type_id, params = {}) ⇒ BacklogKit::Response
Update an issue type
169 170 171 |
# File 'lib/backlog_kit/client/project.rb', line 169 def update_issue_type(project_id_or_key, type_id, params = {}) patch("projects/#{project_id_or_key}/issueTypes/#{type_id}", params) end |
#update_project(project_id_or_key, params = {}) ⇒ BacklogKit::Response
Update a project
38 39 40 |
# File 'lib/backlog_kit/client/project.rb', line 38 def update_project(project_id_or_key, params = {}) patch("projects/#{project_id_or_key}", params) end |
#update_pull_request(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) ⇒ BacklogKit::Response
Update a pull request
378 379 380 |
# File 'lib/backlog_kit/client/project.rb', line 378 def update_pull_request(project_id_or_key, repository_id_or_name, pull_request_number, params = {}) patch("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}", params) end |
#update_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, comment_id, content) ⇒ BacklogKit::Response
Update a comment in pull request
421 422 423 |
# File 'lib/backlog_kit/client/project.rb', line 421 def update_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, comment_id, content) patch("projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/comments/#{comment_id}", content: content) end |
#update_version(project_id_or_key, version_id, params = {}) ⇒ BacklogKit::Response
Update a version
244 245 246 |
# File 'lib/backlog_kit/client/project.rb', line 244 def update_version(project_id_or_key, version_id, params = {}) patch("projects/#{project_id_or_key}/versions/#{version_id}", params) end |
#update_webhook(project_id_or_key, webhook_id, params = {}) ⇒ BacklogKit::Response
Update a webhook
320 321 322 |
# File 'lib/backlog_kit/client/project.rb', line 320 def update_webhook(project_id_or_key, webhook_id, params = {}) patch("projects/#{project_id_or_key}/webhooks/#{webhook_id}", params) end |