gitlab 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitlab/client/access_requests.rb +92 -90
- data/lib/gitlab/client/award_emojis.rb +126 -124
- data/lib/gitlab/client/boards.rb +81 -79
- data/lib/gitlab/client/branches.rb +89 -87
- data/lib/gitlab/client/build_variables.rb +117 -115
- data/lib/gitlab/client/builds.rb +98 -96
- data/lib/gitlab/client/commits.rb +167 -152
- data/lib/gitlab/client/deployments.rb +29 -27
- data/lib/gitlab/client/environments.rb +80 -78
- data/lib/gitlab/client/events.rb +54 -52
- data/lib/gitlab/client/group_milestones.rb +85 -83
- data/lib/gitlab/client/groups.rb +178 -176
- data/lib/gitlab/client/issues.rb +212 -188
- data/lib/gitlab/client/jobs.rb +150 -148
- data/lib/gitlab/client/keys.rb +14 -12
- data/lib/gitlab/client/labels.rb +79 -77
- data/lib/gitlab/client/merge_request_approvals.rb +101 -99
- data/lib/gitlab/client/merge_requests.rb +291 -277
- data/lib/gitlab/client/milestones.rb +85 -83
- data/lib/gitlab/client/namespaces.rb +18 -16
- data/lib/gitlab/client/notes.rb +260 -258
- data/lib/gitlab/client/pipeline_schedules.rb +123 -121
- data/lib/gitlab/client/pipeline_triggers.rb +93 -91
- data/lib/gitlab/client/pipelines.rb +73 -60
- data/lib/gitlab/client/projects.rb +538 -524
- data/lib/gitlab/client/repositories.rb +67 -65
- data/lib/gitlab/client/repository_files.rb +103 -101
- data/lib/gitlab/client/runners.rb +114 -112
- data/lib/gitlab/client/services.rb +45 -43
- data/lib/gitlab/client/sidekiq.rb +32 -30
- data/lib/gitlab/client/snippets.rb +86 -84
- data/lib/gitlab/client/system_hooks.rb +57 -55
- data/lib/gitlab/client/tags.rb +88 -86
- data/lib/gitlab/client/todos.rb +40 -38
- data/lib/gitlab/client/users.rb +243 -241
- data/lib/gitlab/client/versions.rb +13 -11
- data/lib/gitlab/error.rb +1 -1
- data/lib/gitlab/help.rb +1 -1
- data/lib/gitlab/page_links.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +3 -3
data/lib/gitlab/client/groups.rb
CHANGED
@@ -1,193 +1,195 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to groups.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/groups.html
|
6
|
+
module Groups
|
7
|
+
# Gets a list of groups.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.groups
|
11
|
+
# Gitlab.groups({ per_page: 40, page: 2 })
|
12
|
+
#
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def groups(options = {})
|
18
|
+
get('/groups', query: options)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
# Gets a single group.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.group(42)
|
25
|
+
#
|
26
|
+
# @param [Integer] id The ID of a group.
|
27
|
+
# @return [Gitlab::ObjectifiedHash]
|
28
|
+
def group(id)
|
29
|
+
get("/groups/#{url_encode id}")
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
# Creates a new group.
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# Gitlab.create_group('new-group', 'group-path')
|
36
|
+
# Gitlab.create_group('gitlab', 'gitlab-path', { description: 'New Gitlab project' })
|
37
|
+
#
|
38
|
+
# @param [String] name The name of a group.
|
39
|
+
# @param [String] path The path of a group.
|
40
|
+
# @return [Gitlab::ObjectifiedHash] Information about created group.
|
41
|
+
def create_group(name, path, options = {})
|
42
|
+
body = { name: name, path: path }.merge(options)
|
43
|
+
post('/groups', body: body)
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
46
|
+
# Delete's a group.
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
# Gitlab.delete_group(42)
|
50
|
+
# @param [Integer] id The ID of a group
|
51
|
+
# @return [Gitlab::ObjectifiedHash] Information about the deleted group.
|
52
|
+
def delete_group(id)
|
53
|
+
delete("/groups/#{url_encode id}")
|
54
|
+
end
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
56
|
+
# Get a list of group members.
|
57
|
+
#
|
58
|
+
# @example
|
59
|
+
# Gitlab.group_members(1)
|
60
|
+
# Gitlab.group_members(1, { per_page: 40 })
|
61
|
+
#
|
62
|
+
# @param [Integer] id The ID of a group.
|
63
|
+
# @param [Hash] options A customizable set of options.
|
64
|
+
# @option options [Integer] :page The page number.
|
65
|
+
# @option options [Integer] :per_page The number of results per page.
|
66
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
67
|
+
def group_members(id, options = {})
|
68
|
+
get("/groups/#{url_encode id}/members", query: options)
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
71
|
+
# Get details of a single group member.
|
72
|
+
#
|
73
|
+
# @example
|
74
|
+
# Gitlab.group_member(1, 10)
|
75
|
+
#
|
76
|
+
# @param [Integer] team_id The ID of the group to find a member in.
|
77
|
+
# @param [Integer] user_id The user id of the member to find.
|
78
|
+
# @return [Gitlab::ObjectifiedHash] (id, username, name, email, state, access_level ...)
|
79
|
+
def group_member(team_id, user_id)
|
80
|
+
get("/groups/#{url_encode team_id}/members/#{user_id}")
|
81
|
+
end
|
81
82
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
83
|
+
# Adds a user to group.
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
# Gitlab.add_group_member(1, 2, 40)
|
87
|
+
#
|
88
|
+
# @param [Integer] team_id The group id to add a member to.
|
89
|
+
# @param [Integer] user_id The user id of the user to add to the team.
|
90
|
+
# @param [Integer] access_level Project access level.
|
91
|
+
# @return [Gitlab::ObjectifiedHash] Information about added team member.
|
92
|
+
def add_group_member(team_id, user_id, access_level)
|
93
|
+
post("/groups/#{url_encode team_id}/members", body: { user_id: user_id, access_level: access_level })
|
94
|
+
end
|
94
95
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
96
|
+
# Edit a user of a group.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
# Gitlab.edit_group_member(1, 2, 40)
|
100
|
+
#
|
101
|
+
# @param [Integer] team_id The group id of member to edit.
|
102
|
+
# @param [Integer] user_id The user id of the user to edit.
|
103
|
+
# @param [Integer] access_level Project access level.
|
104
|
+
# @return [Gitlab::ObjectifiedHash] Information about edited team member.
|
105
|
+
def edit_group_member(team_id, user_id, access_level)
|
106
|
+
put("/groups/#{url_encode team_id}/members/#{user_id}", body: { access_level: access_level })
|
107
|
+
end
|
107
108
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
109
|
+
# Removes user from user group.
|
110
|
+
#
|
111
|
+
# @example
|
112
|
+
# Gitlab.remove_group_member(1, 2)
|
113
|
+
#
|
114
|
+
# @param [Integer] team_id The group ID.
|
115
|
+
# @param [Integer] user_id The ID of a user.
|
116
|
+
# @return [Gitlab::ObjectifiedHash] Information about removed team member.
|
117
|
+
def remove_group_member(team_id, user_id)
|
118
|
+
delete("/groups/#{url_encode team_id}/members/#{user_id}")
|
119
|
+
end
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
121
|
+
# Transfers a project to a group
|
122
|
+
#
|
123
|
+
# @example
|
124
|
+
# Gitlab.transfer_project_to_group(3, 50)
|
125
|
+
#
|
126
|
+
# @param [Integer] id The ID of a group.
|
127
|
+
# @param [Integer] project_id The ID of a project.
|
128
|
+
def transfer_project_to_group(id, project_id)
|
129
|
+
body = { id: id, project_id: project_id }
|
130
|
+
post("/groups/#{url_encode id}/projects/#{project_id}", body: body)
|
131
|
+
end
|
131
132
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
133
|
+
# Search for groups by name
|
134
|
+
#
|
135
|
+
# @example
|
136
|
+
# Gitlab.group_search('gitlab')
|
137
|
+
#
|
138
|
+
# @param [String] search A string to search for in group names and paths.
|
139
|
+
# @param [Hash] options A customizable set of options.
|
140
|
+
# @option options [String] :per_page Number of projects to return per page
|
141
|
+
# @option options [String] :page The page to retrieve
|
142
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
143
|
+
def group_search(search, options = {})
|
144
|
+
options[:search] = search
|
145
|
+
get('/groups', query: options)
|
146
|
+
end
|
146
147
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
148
|
+
# Get a list of projects under a group
|
149
|
+
# @example
|
150
|
+
# Gitlab.group_projects(1)
|
151
|
+
#
|
152
|
+
# @param [Integer] id The ID of a group
|
153
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of projects under a group
|
154
|
+
def group_projects(id, options = {})
|
155
|
+
get("/groups/#{url_encode id}/projects", query: options)
|
156
|
+
end
|
156
157
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
158
|
+
# Get a list of subgroups under a group
|
159
|
+
# @example
|
160
|
+
# Gitlab.group_subgroups(1)
|
161
|
+
#
|
162
|
+
# @param [Integer] id the ID of a group
|
163
|
+
# @param [Hash] options A customizable set of options.
|
164
|
+
# @option options [String] :skip_groups Skip the group IDs passed.
|
165
|
+
# @option options [String] :all_available Show all the groups you have access to (defaults to false for authenticated users).
|
166
|
+
# @option options [String] :search Return the list of authorized groups matching the search criteria.
|
167
|
+
# @option options [String] :order_by Order groups by name or path. Default is name.
|
168
|
+
# @option options [String] :sort Order groups in asc or desc order. Default is asc.
|
169
|
+
# @option options [String] :statistics Include group statistics (admins only).
|
170
|
+
# @option options [String] :owned Limit to groups owned by the current user.
|
171
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of subgroups under a group
|
172
|
+
def group_subgroups(id, options = {})
|
173
|
+
get("/groups/#{url_encode id}/subgroups", query: options)
|
174
|
+
end
|
174
175
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
176
|
+
# Updates an existing group.
|
177
|
+
#
|
178
|
+
# @example
|
179
|
+
# Gitlab.edit_group(42)
|
180
|
+
# Gitlab.edit_group(42, { name: 'Group Name' })
|
181
|
+
#
|
182
|
+
# @param [Integer] group The ID.
|
183
|
+
# @param [Hash] options A customizable set of options
|
184
|
+
# @option options [String] :name The name of the group.
|
185
|
+
# @option options [String] :path The path of the group.
|
186
|
+
# @option options [String] :description The description of the group.
|
187
|
+
# @option options [String] :visibility The visibility level of the group. Can be private, internal, or public
|
188
|
+
# @option options [String] :lfs_enabled Enable/disable Large File Storage (LFS) for the projects in this groupr.
|
189
|
+
# @option options [String] :request_access_enabled Allow users to request member access.
|
190
|
+
# @return [Gitlab::ObjectifiedHash] Information about the edited group.
|
191
|
+
def edit_group(id, options = {})
|
192
|
+
put("/groups/#{url_encode id}", body: options)
|
193
|
+
end
|
192
194
|
end
|
193
195
|
end
|
data/lib/gitlab/client/issues.rb
CHANGED
@@ -1,207 +1,231 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to issues.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/issues.html
|
6
|
+
module Issues
|
7
|
+
# Gets a list of user's issues.
|
8
|
+
# Will return a list of project's issues if project ID passed.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Gitlab.issues
|
12
|
+
# Gitlab.issues(5)
|
13
|
+
# Gitlab.issues({ per_page: 40 })
|
14
|
+
#
|
15
|
+
# @param [Integer, String] project The ID or name of a project.
|
16
|
+
# @param [Hash] options A customizable set of options.
|
17
|
+
# @option options [Integer] :page The page number.
|
18
|
+
# @option options [Integer] :per_page The number of results per page.
|
19
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
20
|
+
def issues(project = nil, options = {})
|
21
|
+
if project.to_s.empty? && project.to_i.zero?
|
22
|
+
get('/issues', query: options)
|
23
|
+
else
|
24
|
+
get("/projects/#{url_encode project}/issues", query: options)
|
25
|
+
end
|
24
26
|
end
|
25
|
-
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
28
|
+
# Gets a single issue.
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
# Gitlab.issue(5, 42)
|
32
|
+
#
|
33
|
+
# @param [Integer, String] project The ID or name of a project.
|
34
|
+
# @param [Integer] id The ID of an issue.
|
35
|
+
# @return [Gitlab::ObjectifiedHash]
|
36
|
+
def issue(project, id)
|
37
|
+
get("/projects/#{url_encode project}/issues/#{id}")
|
38
|
+
end
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
40
|
+
# Creates a new issue.
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# Gitlab.create_issue(5, 'New issue')
|
44
|
+
# Gitlab.create_issue(5, 'New issue', { description: 'This is a new issue', assignee_id: 42 })
|
45
|
+
#
|
46
|
+
# @param [Integer, String] project The ID or name of a project.
|
47
|
+
# @param [String] title The title of an issue.
|
48
|
+
# @param [Hash] options A customizable set of options.
|
49
|
+
# @option options [String] :description The description of an issue.
|
50
|
+
# @option options [Integer] :assignee_id The ID of a user to assign issue.
|
51
|
+
# @option options [Integer] :milestone_id The ID of a milestone to assign issue.
|
52
|
+
# @option options [String] :labels Comma-separated label names for an issue.
|
53
|
+
# @return [Gitlab::ObjectifiedHash] Information about created issue.
|
54
|
+
def create_issue(project, title, options = {})
|
55
|
+
body = { title: title }.merge(options)
|
56
|
+
post("/projects/#{url_encode project}/issues", body: body)
|
57
|
+
end
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
59
|
+
# Updates an issue.
|
60
|
+
#
|
61
|
+
# @example
|
62
|
+
# Gitlab.edit_issue(6, 1, { title: 'Updated title' })
|
63
|
+
#
|
64
|
+
# @param [Integer, String] project The ID or name of a project.
|
65
|
+
# @param [Integer] id The ID of an issue.
|
66
|
+
# @param [Hash] options A customizable set of options.
|
67
|
+
# @option options [String] :title The title of an issue.
|
68
|
+
# @option options [String] :description The description of an issue.
|
69
|
+
# @option options [Integer] :assignee_id The ID of a user to assign issue.
|
70
|
+
# @option options [Integer] :milestone_id The ID of a milestone to assign issue.
|
71
|
+
# @option options [String] :labels Comma-separated label names for an issue.
|
72
|
+
# @option options [String] :state_event The state event of an issue ('close' or 'reopen').
|
73
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated issue.
|
74
|
+
def edit_issue(project, id, options = {})
|
75
|
+
put("/projects/#{url_encode project}/issues/#{id}", body: options)
|
76
|
+
end
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
78
|
+
# Closes an issue.
|
79
|
+
#
|
80
|
+
# @example
|
81
|
+
# Gitlab.close_issue(3, 42)
|
82
|
+
#
|
83
|
+
# @param [Integer, String] project The ID or name of a project.
|
84
|
+
# @param [Integer] id The ID of an issue.
|
85
|
+
# @return [Gitlab::ObjectifiedHash] Information about closed issue.
|
86
|
+
def close_issue(project, id)
|
87
|
+
put("/projects/#{url_encode project}/issues/#{id}", body: { state_event: 'close' })
|
88
|
+
end
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
90
|
+
# Reopens an issue.
|
91
|
+
#
|
92
|
+
# @example
|
93
|
+
# Gitlab.reopen_issue(3, 42)
|
94
|
+
#
|
95
|
+
# @param [Integer, String] project The ID or name of a project.
|
96
|
+
# @param [Integer] id The ID of an issue.
|
97
|
+
# @return [Gitlab::ObjectifiedHash] Information about reopened issue.
|
98
|
+
def reopen_issue(project, id)
|
99
|
+
put("/projects/#{url_encode project}/issues/#{id}", body: { state_event: 'reopen' })
|
100
|
+
end
|
100
101
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
102
|
+
# Subscribe to an issue.
|
103
|
+
#
|
104
|
+
# @example
|
105
|
+
# Gitlab.subscribe_to_issue(3, 42)
|
106
|
+
#
|
107
|
+
# @param [Integer, String] project The ID or name of a project.
|
108
|
+
# @param [Integer] id The ID of an issue.
|
109
|
+
# @return [Gitlab::ObjectifiedHash] Information about subscribed issue.
|
110
|
+
def subscribe_to_issue(project, id)
|
111
|
+
post("/projects/#{url_encode project}/issues/#{id}/subscribe")
|
112
|
+
end
|
112
113
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
# Unsubscribe from an issue.
|
115
|
+
#
|
116
|
+
# @example
|
117
|
+
# Gitlab.unsubscribe_from_issue(3, 42)
|
118
|
+
#
|
119
|
+
# @param [Integer, String] project The ID or name of a project.
|
120
|
+
# @param [Integer] id The ID of an issue.
|
121
|
+
# @return [Gitlab::ObjectifiedHash] Information about unsubscribed issue.
|
122
|
+
def unsubscribe_from_issue(project, id)
|
123
|
+
post("/projects/#{url_encode project}/issues/#{id}/unsubscribe")
|
124
|
+
end
|
124
125
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
126
|
+
# Deletes an issue.
|
127
|
+
# Only for admins and project owners
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
# Gitlab.delete_issue(3, 42)
|
131
|
+
#
|
132
|
+
# @param [Integer, String] project The ID or name of a project.
|
133
|
+
# @param [Integer] id The ID of an issue.
|
134
|
+
# @return [Gitlab::ObjectifiedHash] Information about deleted issue.
|
135
|
+
def delete_issue(project, id)
|
136
|
+
delete("/projects/#{url_encode project}/issues/#{id}")
|
137
|
+
end
|
137
138
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
139
|
+
# Move an issue.
|
140
|
+
#
|
141
|
+
# @example
|
142
|
+
# Gitlab.move_issue(3, 42, { to_project_id: '4' })
|
143
|
+
#
|
144
|
+
# @param [Integer, String] project The ID or name of a project.
|
145
|
+
# @param [Integer] id The ID of an issue.
|
146
|
+
# @option options [String] :to_project_id The ID of the new project.
|
147
|
+
# @return [Gitlab::ObjectifiedHash] Information about moved issue.
|
148
|
+
def move_issue(project, id, options = {})
|
149
|
+
post("/projects/#{url_encode project}/issues/#{id}/move", body: options)
|
150
|
+
end
|
150
151
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
152
|
+
# Sets an estimated time of work for an issue.
|
153
|
+
#
|
154
|
+
# @example
|
155
|
+
# Gitlab.estimate_time_of_issue(3, 42, '3h30m')
|
156
|
+
#
|
157
|
+
# @param [Integer, String] project The ID or name of a project.
|
158
|
+
# @param [Integer] id The ID of an issue.
|
159
|
+
# @param [String] duration The duration in human format. e.g: 3h30m
|
160
|
+
def estimate_time_of_issue(project, id, duration)
|
161
|
+
post("/projects/#{url_encode project}/issues/#{id}/time_estimate", body: { duration: url_encode(duration) })
|
162
|
+
end
|
162
163
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
164
|
+
# Resets the estimated time for an issue to 0 seconds.
|
165
|
+
#
|
166
|
+
# @example
|
167
|
+
# Gitlab.reset_time_estimate_of_issue(3, 42)
|
168
|
+
#
|
169
|
+
# @param [Integer, String] project The ID or name of a project.
|
170
|
+
# @param [Integer] id The ID of an issue.
|
171
|
+
def reset_time_estimate_of_issue(project, id)
|
172
|
+
post("/projects/#{url_encode project}/issues/#{id}/reset_time_estimate")
|
173
|
+
end
|
173
174
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
175
|
+
# Adds spent time for an issue
|
176
|
+
#
|
177
|
+
# @example
|
178
|
+
# Gitlab.estimate_time_of_issue(3, 42, '3h30m')
|
179
|
+
#
|
180
|
+
# @param [Integer, String] project The ID or name of a project.
|
181
|
+
# @param [Integer] id The ID of an issue.
|
182
|
+
# @param [String] duration The time spent in human format. e.g: 3h30m
|
183
|
+
def add_time_spent_on_issue(project, id, duration)
|
184
|
+
post("/projects/#{url_encode project}/issues/#{id}/add_spent_time", body: { duration: url_encode(duration) })
|
185
|
+
end
|
185
186
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
187
|
+
# Resets the total spent time for this issue to 0 seconds.
|
188
|
+
#
|
189
|
+
# @example
|
190
|
+
# Gitlab.reset_time_spent_on_issue(3, 42)
|
191
|
+
#
|
192
|
+
# @param [Integer, String] project The ID or name of a project.
|
193
|
+
# @param [Integer] id The ID of an issue.
|
194
|
+
def reset_time_spent_on_issue(project, id)
|
195
|
+
post("/projects/#{url_encode project}/issues/#{id}/reset_spent_time")
|
196
|
+
end
|
197
|
+
|
198
|
+
# Get time tracking stats for an issue
|
199
|
+
#
|
200
|
+
# @example
|
201
|
+
# @gitlab.time_stats_for_issue(3, 42)
|
202
|
+
#
|
203
|
+
# @param [Integer, String] project The ID or name of a project.
|
204
|
+
# @param [Integer] id The ID of an issue.
|
205
|
+
def time_stats_for_issue(project, id)
|
206
|
+
get("/projects/#{url_encode project}/issues/#{id}/time_stats")
|
207
|
+
end
|
208
|
+
|
209
|
+
# Get participants on issue
|
210
|
+
#
|
211
|
+
# @example
|
212
|
+
# @gitlab.participants_on_issue(3, 42)
|
213
|
+
#
|
214
|
+
# @param [Integer, String] project The ID or name of a project.
|
215
|
+
# @param [Integer] id The ID of an issue.
|
216
|
+
def participants_on_issue(project, id)
|
217
|
+
get("/projects/#{url_encode project}/issues/#{id}/participants")
|
218
|
+
end
|
196
219
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
220
|
+
# List merge requests that will close issue on merge
|
221
|
+
#
|
222
|
+
# @example
|
223
|
+
# Gitlab.merge_requests_closing_issue_on_merge(3, 42)
|
224
|
+
#
|
225
|
+
# @param [Integer, String] project The ID or name of a project.
|
226
|
+
# @param [Integer] id The ID of an issue.
|
227
|
+
def merge_requests_closing_issue_on_merge(project, id)
|
228
|
+
get("/projects/#{url_encode project}/issues/#{id}/closed_by")
|
229
|
+
end
|
206
230
|
end
|
207
231
|
end
|