gitlab 4.5.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/stale.yml +18 -0
  3. data/.rubocop_todo.yml +46 -0
  4. data/Gemfile +2 -0
  5. data/README.md +22 -22
  6. data/Rakefile +3 -5
  7. data/bin/console +1 -0
  8. data/exe/gitlab +5 -1
  9. data/gitlab.gemspec +9 -6
  10. data/lib/gitlab.rb +6 -3
  11. data/lib/gitlab/api.rb +5 -3
  12. data/lib/gitlab/cli.rb +11 -5
  13. data/lib/gitlab/cli_helpers.rb +31 -22
  14. data/lib/gitlab/client.rb +7 -8
  15. data/lib/gitlab/client/access_requests.rb +100 -93
  16. data/lib/gitlab/client/award_emojis.rb +127 -127
  17. data/lib/gitlab/client/boards.rb +82 -82
  18. data/lib/gitlab/client/branches.rb +89 -89
  19. data/lib/gitlab/client/build_variables.rb +117 -117
  20. data/lib/gitlab/client/builds.rb +98 -98
  21. data/lib/gitlab/client/commits.rb +154 -154
  22. data/lib/gitlab/client/deployments.rb +29 -29
  23. data/lib/gitlab/client/environments.rb +80 -80
  24. data/lib/gitlab/client/events.rb +54 -54
  25. data/lib/gitlab/client/group_milestones.rb +85 -86
  26. data/lib/gitlab/client/groups.rb +178 -178
  27. data/lib/gitlab/client/issues.rb +195 -196
  28. data/lib/gitlab/client/jobs.rb +150 -150
  29. data/lib/gitlab/client/keys.rb +14 -14
  30. data/lib/gitlab/client/labels.rb +79 -79
  31. data/lib/gitlab/client/merge_request_approvals.rb +102 -102
  32. data/lib/gitlab/client/merge_requests.rb +281 -256
  33. data/lib/gitlab/client/milestones.rb +85 -85
  34. data/lib/gitlab/client/namespaces.rb +18 -18
  35. data/lib/gitlab/client/notes.rb +260 -260
  36. data/lib/gitlab/client/pipeline_schedules.rb +123 -123
  37. data/lib/gitlab/client/pipeline_triggers.rb +93 -93
  38. data/lib/gitlab/client/pipelines.rb +62 -62
  39. data/lib/gitlab/client/projects.rb +526 -505
  40. data/lib/gitlab/client/repositories.rb +68 -55
  41. data/lib/gitlab/client/repository_files.rb +103 -103
  42. data/lib/gitlab/client/runners.rb +113 -115
  43. data/lib/gitlab/client/services.rb +46 -45
  44. data/lib/gitlab/client/sidekiq.rb +32 -32
  45. data/lib/gitlab/client/snippets.rb +86 -86
  46. data/lib/gitlab/client/system_hooks.rb +57 -57
  47. data/lib/gitlab/client/tags.rb +87 -88
  48. data/lib/gitlab/client/todos.rb +41 -41
  49. data/lib/gitlab/client/users.rb +242 -228
  50. data/lib/gitlab/client/versions.rb +16 -0
  51. data/lib/gitlab/configuration.rb +7 -5
  52. data/lib/gitlab/error.rb +3 -1
  53. data/lib/gitlab/file_response.rb +4 -2
  54. data/lib/gitlab/help.rb +9 -9
  55. data/lib/gitlab/objectified_hash.rb +5 -4
  56. data/lib/gitlab/page_links.rb +9 -7
  57. data/lib/gitlab/paginated_response.rb +14 -4
  58. data/lib/gitlab/request.rb +8 -5
  59. data/lib/gitlab/shell.rb +6 -4
  60. data/lib/gitlab/shell_history.rb +7 -5
  61. data/lib/gitlab/version.rb +3 -1
  62. metadata +8 -5
@@ -1,162 +1,162 @@
1
- class Gitlab::Client
2
- # Defines methods related to projects.
3
- # @see https://docs.gitlab.com/ee/api/jobs.html
4
- module Jobs
5
- # Gets a list of Jobs for a Project
6
- #
7
- # @example
8
- # Gitlab.jobs(1)
9
- # Gitlab.jobs("project")
10
- #
11
- # @param [Integer, String] id The ID or name of a project.
12
- # @param [Hash] options A customizable set of options.
13
- # @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
14
- # @return [Array<Gitlab::ObjectifiedHash>]
15
- def jobs(project_id, options = {})
16
- get("/projects/#{url_encode project_id}/jobs", query: options)
17
- end
1
+ # frozen_string_literal: true
18
2
 
19
- # Gets a list of Jobs from a pipeline
20
- #
21
- # @example
22
- # Gitlab.pipeline_jobs(1, 2)
23
- # Gitlab.pipeline_jobs("project", 2)
24
- #
25
- # @param [Integer, String] The ID or name of a project.
26
- # @param [Integer] the id of the pipeline
27
- # @param [Hash] options A customizable set of options.
28
- # @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
29
- # @return [Array<Gitlab::ObjectifiedHash>]
30
- def pipeline_jobs(project_id, pipeline_id, options = {})
31
- get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: options)
32
- end
3
+ # Defines methods related to projects.
4
+ # @see https://docs.gitlab.com/ee/api/jobs.html
5
+ module Jobs
6
+ # Gets a list of Jobs for a Project
7
+ #
8
+ # @example
9
+ # Gitlab.jobs(1)
10
+ # Gitlab.jobs("project")
11
+ #
12
+ # @param [Integer, String] id The ID or name of a project.
13
+ # @param [Hash] options A customizable set of options.
14
+ # @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
15
+ # @return [Array<Gitlab::ObjectifiedHash>]
16
+ def jobs(project_id, options = {})
17
+ get("/projects/#{url_encode project_id}/jobs", query: options)
18
+ end
33
19
 
34
- # Gets a single job
35
- #
36
- # @example
37
- # Gitlab.job(1, 2)
38
- # Gitlab.job("project", 2)
39
- #
40
- # @param [Integer, String] The ID or name of a project.
41
- # @param [Integer] the id of the job
42
- def job(project_id, job_id)
43
- get("/projects/#{url_encode project_id}/jobs/#{job_id}")
44
- end
20
+ # Gets a list of Jobs from a pipeline
21
+ #
22
+ # @example
23
+ # Gitlab.pipeline_jobs(1, 2)
24
+ # Gitlab.pipeline_jobs("project", 2)
25
+ #
26
+ # @param [Integer, String] The ID or name of a project.
27
+ # @param [Integer] the id of the pipeline
28
+ # @param [Hash] options A customizable set of options.
29
+ # @option options [Array] :scope The scope of jobs to show, one or array of: created, pending, running, failed, success, canceled, skipped, manual; showing all jobs if none provided.
30
+ # @return [Array<Gitlab::ObjectifiedHash>]
31
+ def pipeline_jobs(project_id, pipeline_id, options = {})
32
+ get("/projects/#{url_encode project_id}/pipelines/#{pipeline_id}/jobs", query: options)
33
+ end
45
34
 
46
- # Gets artifacts from a job
47
- #
48
- # @example
49
- # Gitlab.job_artifacts(1, 2)
50
- # Gitlab.job_artifacts("project", 2)
51
- #
52
- # @param [Integer, String] The ID or name of a project.
53
- # @param [Integer] the id of the job
54
- # @return [Array<Gitlab::ObjectifiedHash>]
55
- def job_artifacts(project_id, job_id)
56
- get("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts",
57
- format: nil,
58
- headers: { Accept: 'text/plain' },
59
- parser: ::Gitlab::Request::Parser)
60
- end
35
+ # Gets a single job
36
+ #
37
+ # @example
38
+ # Gitlab.job(1, 2)
39
+ # Gitlab.job("project", 2)
40
+ #
41
+ # @param [Integer, String] The ID or name of a project.
42
+ # @param [Integer] the id of the job
43
+ def job(project_id, job_id)
44
+ get("/projects/#{url_encode project_id}/jobs/#{job_id}")
45
+ end
61
46
 
62
- # Download Job Artifact
63
- #
64
- # @example
65
- # Gitlab.job_artifacts_download(1, "master", "release")
66
- # Gitlab.job_artifacts_download("project", "master", "release")
67
- #
68
- # @param [Integer, String] id, The ID or name of a project.
69
- # @param [String] ref, Ref Name
70
- # @param [String] job, jobname
71
- # @return [Array<Gitlab::ObjectifiedHash>]
72
- def job_artifacts_download(project_id, ref_name, job_name)
73
- get("/projects/#{url_encode project_id}/jobs/artifacts/#{ref_name}/download", query: { job: job_name },
74
- format: nil,
75
- headers: { Accept: 'text/plain' },
76
- parser: ::Gitlab::Request::Parser)
77
- end
47
+ # Gets artifacts from a job
48
+ #
49
+ # @example
50
+ # Gitlab.job_artifacts(1, 2)
51
+ # Gitlab.job_artifacts("project", 2)
52
+ #
53
+ # @param [Integer, String] The ID or name of a project.
54
+ # @param [Integer] the id of the job
55
+ # @return [Array<Gitlab::ObjectifiedHash>]
56
+ def job_artifacts(project_id, job_id)
57
+ get("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts",
58
+ format: nil,
59
+ headers: { Accept: 'text/plain' },
60
+ parser: ::Gitlab::Request::Parser)
61
+ end
78
62
 
79
- # Get Job Trace
80
- #
81
- # @example
82
- # Gitlab.job_trace(1,1)
83
- # Gitlab.job_trace("project", 1)
84
- #
85
- # @param [Integer, String] The ID or name of a project.
86
- # @param [Integer] the id of the job
87
- # @return [Array<Gitlab::ObjectifiedHash>]
88
- def job_trace(project_id, job_id)
89
- get("/projects/#{url_encode project_id}/jobs/#{job_id}/trace",
90
- format: nil,
91
- headers: { Accept: 'text/plain' },
92
- parser: ::Gitlab::Request::Parser)
93
- end
63
+ # Download Job Artifact
64
+ #
65
+ # @example
66
+ # Gitlab.job_artifacts_download(1, "master", "release")
67
+ # Gitlab.job_artifacts_download("project", "master", "release")
68
+ #
69
+ # @param [Integer, String] id, The ID or name of a project.
70
+ # @param [String] ref, Ref Name
71
+ # @param [String] job, jobname
72
+ # @return [Array<Gitlab::ObjectifiedHash>]
73
+ def job_artifacts_download(project_id, ref_name, job_name)
74
+ get("/projects/#{url_encode project_id}/jobs/artifacts/#{ref_name}/download", query: { job: job_name },
75
+ format: nil,
76
+ headers: { Accept: 'text/plain' },
77
+ parser: ::Gitlab::Request::Parser)
78
+ end
94
79
 
95
- # Cancel a job
96
- #
97
- # @example
98
- # Gitlab.job_cancel(1,1)
99
- # Gitlab.job_cancel("project", 1)
100
- #
101
- # @param [Integer, String] The ID or name of a project.
102
- # @param [Integer] the id of the job
103
- # @return [Array<Gitlab::ObjectifiedHash>]
104
- def job_cancel(project_id, job_id)
105
- post("/projects/#{url_encode project_id}/jobs/#{job_id}/cancel")
106
- end
80
+ # Get Job Trace
81
+ #
82
+ # @example
83
+ # Gitlab.job_trace(1,1)
84
+ # Gitlab.job_trace("project", 1)
85
+ #
86
+ # @param [Integer, String] The ID or name of a project.
87
+ # @param [Integer] the id of the job
88
+ # @return [Array<Gitlab::ObjectifiedHash>]
89
+ def job_trace(project_id, job_id)
90
+ get("/projects/#{url_encode project_id}/jobs/#{job_id}/trace",
91
+ format: nil,
92
+ headers: { Accept: 'text/plain' },
93
+ parser: ::Gitlab::Request::Parser)
94
+ end
107
95
 
108
- # Retry a job
109
- #
110
- # @example
111
- # Gitlab.job_retry(1,1)
112
- # Gitlab.job_retry("project", 1)
113
- #
114
- # @param [Integer, String] The ID or name of a project.
115
- # @param [Integer] the id of the job
116
- # @return [Array<Gitlab::ObjectifiedHash>]
117
- def job_retry(project_id, job_id)
118
- post("/projects/#{url_encode project_id}/jobs/#{job_id}/retry")
119
- end
96
+ # Cancel a job
97
+ #
98
+ # @example
99
+ # Gitlab.job_cancel(1,1)
100
+ # Gitlab.job_cancel("project", 1)
101
+ #
102
+ # @param [Integer, String] The ID or name of a project.
103
+ # @param [Integer] the id of the job
104
+ # @return [Array<Gitlab::ObjectifiedHash>]
105
+ def job_cancel(project_id, job_id)
106
+ post("/projects/#{url_encode project_id}/jobs/#{job_id}/cancel")
107
+ end
120
108
 
121
- # Erase Job
122
- #
123
- # @example
124
- # Gitlab.job_erase(1,1)
125
- # Gitlab.job_erase("project", 1)
126
- #
127
- # @param [Integer, String] The ID or name of a project.
128
- # @param [Integer] the id of the job
129
- # @return [Array<Gitlab::ObjectifiedHash>]
130
- def job_erase(project_id, job_id)
131
- post("/projects/#{url_encode project_id}/jobs/#{job_id}/erase")
132
- end
109
+ # Retry a job
110
+ #
111
+ # @example
112
+ # Gitlab.job_retry(1,1)
113
+ # Gitlab.job_retry("project", 1)
114
+ #
115
+ # @param [Integer, String] The ID or name of a project.
116
+ # @param [Integer] the id of the job
117
+ # @return [Array<Gitlab::ObjectifiedHash>]
118
+ def job_retry(project_id, job_id)
119
+ post("/projects/#{url_encode project_id}/jobs/#{job_id}/retry")
120
+ end
133
121
 
134
- # Play a Job
135
- # Triggers a manual action to start a job.
136
- #
137
- # @example
138
- # Gitlab.job_play(1,1)
139
- # Gitlab.job_play("project", 1)
140
- #
141
- # @param [Integer, String] The ID or name of a project.
142
- # @param [Integer] the id of the job
143
- # @return [Array<Gitlab::ObjectifiedHash>]
144
- def job_play(project_id, job_id)
145
- post("/projects/#{url_encode project_id}/jobs/#{job_id}/play")
146
- end
122
+ # Erase Job
123
+ #
124
+ # @example
125
+ # Gitlab.job_erase(1,1)
126
+ # Gitlab.job_erase("project", 1)
127
+ #
128
+ # @param [Integer, String] The ID or name of a project.
129
+ # @param [Integer] the id of the job
130
+ # @return [Array<Gitlab::ObjectifiedHash>]
131
+ def job_erase(project_id, job_id)
132
+ post("/projects/#{url_encode project_id}/jobs/#{job_id}/erase")
133
+ end
134
+
135
+ # Play a Job
136
+ # Triggers a manual action to start a job.
137
+ #
138
+ # @example
139
+ # Gitlab.job_play(1,1)
140
+ # Gitlab.job_play("project", 1)
141
+ #
142
+ # @param [Integer, String] The ID or name of a project.
143
+ # @param [Integer] the id of the job
144
+ # @return [Array<Gitlab::ObjectifiedHash>]
145
+ def job_play(project_id, job_id)
146
+ post("/projects/#{url_encode project_id}/jobs/#{job_id}/play")
147
+ end
147
148
 
148
- # Keep Artifacts
149
- # Prevents artifacts from being deleted when expiration is set.
150
- #
151
- # @example
152
- # Gitlab.job_artifacts_keep(1,1)
153
- # Gitlab.job_artifacts_keep("project", 1)
154
- #
155
- # @param [Integer, String] The ID or name of a project.
156
- # @param [Integer] the id of the job
157
- # @return [Array<Gitlab::ObjectifiedHash>]
158
- def job_artifacts_keep(project_id, job_id)
159
- post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep")
160
- end
149
+ # Keep Artifacts
150
+ # Prevents artifacts from being deleted when expiration is set.
151
+ #
152
+ # @example
153
+ # Gitlab.job_artifacts_keep(1,1)
154
+ # Gitlab.job_artifacts_keep("project", 1)
155
+ #
156
+ # @param [Integer, String] The ID or name of a project.
157
+ # @param [Integer] the id of the job
158
+ # @return [Array<Gitlab::ObjectifiedHash>]
159
+ def job_artifacts_keep(project_id, job_id)
160
+ post("/projects/#{url_encode project_id}/jobs/#{job_id}/artifacts/keep")
161
161
  end
162
162
  end
@@ -1,16 +1,16 @@
1
- class Gitlab::Client
2
- # Defines methods related to keys.
3
- # @see https://docs.gitlab.com/ce/api/keys.html
4
- module Keys
5
- # Gets information about a key.
6
- #
7
- # @example
8
- # Gitlab.key(1)
9
- #
10
- # @param [Integer] id The ID of a key.
11
- # @return [Gitlab::ObjectifiedHash]
12
- def key(id)
13
- get("/keys/#{id}")
14
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Defines methods related to keys.
4
+ # @see https://docs.gitlab.com/ce/api/keys.html
5
+ module Keys
6
+ # Gets information about a key.
7
+ #
8
+ # @example
9
+ # Gitlab.key(1)
10
+ #
11
+ # @param [Integer] id The ID of a key.
12
+ # @return [Gitlab::ObjectifiedHash]
13
+ def key(id)
14
+ get("/keys/#{id}")
15
15
  end
16
16
  end
@@ -1,86 +1,86 @@
1
- class Gitlab::Client
2
- # Defines methods related to labels.
3
- # @see https://docs.gitlab.com/ce/api/labels.html
4
- module Labels
5
- # Gets a list of project's labels.
6
- #
7
- # @example
8
- # Gitlab.labels(5)
9
- #
10
- # @param [Integer, String] project The ID or name of a project.
11
- # @return [Array<Gitlab::ObjectifiedHash>]
12
- def labels(project, options={})
13
- get("/projects/#{url_encode project}/labels", query: options)
14
- end
1
+ # frozen_string_literal: true
15
2
 
16
- # Creates a new label.
17
- #
18
- # @example
19
- # Gitlab.create_label(42, "Backlog", '#DD10AA')
20
- #
21
- # @param [Integer, String] project The ID or name of a project.
22
- # @param [String] name The name of a label.
23
- # @param [String] color The color of a label.
24
- # @param [Hash] options A customizable set of options.
25
- # @option options [String] :description The description of the label.
26
- # @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
27
- # @return [Gitlab::ObjectifiedHash] Information about created label.
28
- def create_label(project, name, color, options = {})
29
- post("/projects/#{url_encode project}/labels", body: options.merge(name: name, color: color))
30
- end
3
+ # Defines methods related to labels.
4
+ # @see https://docs.gitlab.com/ce/api/labels.html
5
+ module Labels
6
+ # Gets a list of project's labels.
7
+ #
8
+ # @example
9
+ # Gitlab.labels(5)
10
+ #
11
+ # @param [Integer, String] project The ID or name of a project.
12
+ # @return [Array<Gitlab::ObjectifiedHash>]
13
+ def labels(project, options = {})
14
+ get("/projects/#{url_encode project}/labels", query: options)
15
+ end
16
+
17
+ # Creates a new label.
18
+ #
19
+ # @example
20
+ # Gitlab.create_label(42, "Backlog", '#DD10AA')
21
+ #
22
+ # @param [Integer, String] project The ID or name of a project.
23
+ # @param [String] name The name of a label.
24
+ # @param [String] color The color of a label.
25
+ # @param [Hash] options A customizable set of options.
26
+ # @option options [String] :description The description of the label.
27
+ # @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
28
+ # @return [Gitlab::ObjectifiedHash] Information about created label.
29
+ def create_label(project, name, color, options = {})
30
+ post("/projects/#{url_encode project}/labels", body: options.merge(name: name, color: color))
31
+ end
31
32
 
32
- # Updates a label.
33
- #
34
- # @example
35
- # Gitlab.edit_label(42, "Backlog", { new_name: 'TODO' })
36
- # Gitlab.edit_label(42, "Backlog", { new_name: 'TODO', color: '#DD10AA' })
37
- #
38
- # @param [Integer, String] project The ID or name of a project.
39
- # @param [String] name The name of a label.
40
- # @param [Hash] options A customizable set of options.
41
- # @option options [String] :new_name The new name of a label.
42
- # @option options [String] :color The color of a label.
43
- # @option options [String] :description The description of the label.
44
- # @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
45
- # @return [Gitlab::ObjectifiedHash] Information about updated label.
46
- def edit_label(project, name, options={})
47
- put("/projects/#{url_encode project}/labels", body: options.merge(name: name))
48
- end
33
+ # Updates a label.
34
+ #
35
+ # @example
36
+ # Gitlab.edit_label(42, "Backlog", { new_name: 'TODO' })
37
+ # Gitlab.edit_label(42, "Backlog", { new_name: 'TODO', color: '#DD10AA' })
38
+ #
39
+ # @param [Integer, String] project The ID or name of a project.
40
+ # @param [String] name The name of a label.
41
+ # @param [Hash] options A customizable set of options.
42
+ # @option options [String] :new_name The new name of a label.
43
+ # @option options [String] :color The color of a label.
44
+ # @option options [String] :description The description of the label.
45
+ # @option options [String] :priority The priority of the label. Must be greater or equal than zero or null to remove the priority.
46
+ # @return [Gitlab::ObjectifiedHash] Information about updated label.
47
+ def edit_label(project, name, options = {})
48
+ put("/projects/#{url_encode project}/labels", body: options.merge(name: name))
49
+ end
49
50
 
50
- # Deletes a label.
51
- #
52
- # @example
53
- # Gitlab.delete_label(2, 'Backlog')
54
- #
55
- # @param [Integer, String] project The ID or name of a project.
56
- # @param [String] name The name of a label.
57
- # @return [Gitlab::ObjectifiedHash] Information about deleted label.
58
- def delete_label(project, name)
59
- delete("/projects/#{url_encode project}/labels", body: { name: name })
60
- end
51
+ # Deletes a label.
52
+ #
53
+ # @example
54
+ # Gitlab.delete_label(2, 'Backlog')
55
+ #
56
+ # @param [Integer, String] project The ID or name of a project.
57
+ # @param [String] name The name of a label.
58
+ # @return [Gitlab::ObjectifiedHash] Information about deleted label.
59
+ def delete_label(project, name)
60
+ delete("/projects/#{url_encode project}/labels", body: { name: name })
61
+ end
61
62
 
62
- # Subscribes the user to a label to receive notifications
63
- #
64
- # @example
65
- # Gitlab.subscribe_to_label(2, 'Backlog')
66
- #
67
- # @param [Integer, String] project The ID or name of a project.
68
- # @param [String] name The name of a label.
69
- # @return [Gitlab::ObjectifiedHash] Information about the label subscribed to.
70
- def subscribe_to_label(project, name)
71
- post("/projects/#{url_encode project}/labels/#{url_encode name}/subscribe")
72
- end
63
+ # Subscribes the user to a label to receive notifications
64
+ #
65
+ # @example
66
+ # Gitlab.subscribe_to_label(2, 'Backlog')
67
+ #
68
+ # @param [Integer, String] project The ID or name of a project.
69
+ # @param [String] name The name of a label.
70
+ # @return [Gitlab::ObjectifiedHash] Information about the label subscribed to.
71
+ def subscribe_to_label(project, name)
72
+ post("/projects/#{url_encode project}/labels/#{url_encode name}/subscribe")
73
+ end
73
74
 
74
- # Unsubscribes the user from a label to not receive notifications from it
75
- #
76
- # @example
77
- # Gitlab.unsubscribe_from_label(2, 'Backlog')
78
- #
79
- # @param [Integer, String] project The ID or name of a project.
80
- # @param [String] name The name of a label.
81
- # @return [Gitlab::ObjectifiedHash] Information about the label unsubscribed from.
82
- def unsubscribe_from_label(project, name)
83
- post("/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe")
84
- end
75
+ # Unsubscribes the user from a label to not receive notifications from it
76
+ #
77
+ # @example
78
+ # Gitlab.unsubscribe_from_label(2, 'Backlog')
79
+ #
80
+ # @param [Integer, String] project The ID or name of a project.
81
+ # @param [String] name The name of a label.
82
+ # @return [Gitlab::ObjectifiedHash] Information about the label unsubscribed from.
83
+ def unsubscribe_from_label(project, name)
84
+ post("/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe")
85
85
  end
86
86
  end