gitlab 4.5.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/stale.yml +18 -0
- data/.rubocop_todo.yml +46 -0
- data/Gemfile +2 -0
- data/README.md +22 -22
- data/Rakefile +3 -5
- data/bin/console +1 -0
- data/exe/gitlab +5 -1
- data/gitlab.gemspec +9 -6
- data/lib/gitlab.rb +6 -3
- data/lib/gitlab/api.rb +5 -3
- data/lib/gitlab/cli.rb +11 -5
- data/lib/gitlab/cli_helpers.rb +31 -22
- data/lib/gitlab/client.rb +7 -8
- data/lib/gitlab/client/access_requests.rb +100 -93
- data/lib/gitlab/client/award_emojis.rb +127 -127
- data/lib/gitlab/client/boards.rb +82 -82
- data/lib/gitlab/client/branches.rb +89 -89
- data/lib/gitlab/client/build_variables.rb +117 -117
- data/lib/gitlab/client/builds.rb +98 -98
- data/lib/gitlab/client/commits.rb +154 -154
- data/lib/gitlab/client/deployments.rb +29 -29
- data/lib/gitlab/client/environments.rb +80 -80
- data/lib/gitlab/client/events.rb +54 -54
- data/lib/gitlab/client/group_milestones.rb +85 -86
- data/lib/gitlab/client/groups.rb +178 -178
- data/lib/gitlab/client/issues.rb +195 -196
- data/lib/gitlab/client/jobs.rb +150 -150
- data/lib/gitlab/client/keys.rb +14 -14
- data/lib/gitlab/client/labels.rb +79 -79
- data/lib/gitlab/client/merge_request_approvals.rb +102 -102
- data/lib/gitlab/client/merge_requests.rb +281 -256
- data/lib/gitlab/client/milestones.rb +85 -85
- data/lib/gitlab/client/namespaces.rb +18 -18
- data/lib/gitlab/client/notes.rb +260 -260
- data/lib/gitlab/client/pipeline_schedules.rb +123 -123
- data/lib/gitlab/client/pipeline_triggers.rb +93 -93
- data/lib/gitlab/client/pipelines.rb +62 -62
- data/lib/gitlab/client/projects.rb +526 -505
- data/lib/gitlab/client/repositories.rb +68 -55
- data/lib/gitlab/client/repository_files.rb +103 -103
- data/lib/gitlab/client/runners.rb +113 -115
- data/lib/gitlab/client/services.rb +46 -45
- data/lib/gitlab/client/sidekiq.rb +32 -32
- data/lib/gitlab/client/snippets.rb +86 -86
- data/lib/gitlab/client/system_hooks.rb +57 -57
- data/lib/gitlab/client/tags.rb +87 -88
- data/lib/gitlab/client/todos.rb +41 -41
- data/lib/gitlab/client/users.rb +242 -228
- data/lib/gitlab/client/versions.rb +16 -0
- data/lib/gitlab/configuration.rb +7 -5
- data/lib/gitlab/error.rb +3 -1
- data/lib/gitlab/file_response.rb +4 -2
- data/lib/gitlab/help.rb +9 -9
- data/lib/gitlab/objectified_hash.rb +5 -4
- data/lib/gitlab/page_links.rb +9 -7
- data/lib/gitlab/paginated_response.rb +14 -4
- data/lib/gitlab/request.rb +8 -5
- data/lib/gitlab/shell.rb +6 -4
- data/lib/gitlab/shell_history.rb +7 -5
- data/lib/gitlab/version.rb +3 -1
- metadata +8 -5
data/lib/gitlab/client.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gitlab
|
2
4
|
# Wrapper for the Gitlab REST API.
|
3
5
|
class Client < API
|
4
|
-
Dir[File.expand_path('
|
6
|
+
Dir[File.expand_path('client/*.rb', __dir__)].each { |f| require f }
|
5
7
|
|
6
8
|
# Please keep in alphabetical order
|
7
9
|
include AccessRequests
|
@@ -39,22 +41,19 @@ module Gitlab
|
|
39
41
|
include Tags
|
40
42
|
include Todos
|
41
43
|
include Users
|
44
|
+
include Versions
|
42
45
|
|
43
46
|
# Text representation of the client, masking private token.
|
44
47
|
#
|
45
48
|
# @return [String]
|
46
49
|
def inspect
|
47
50
|
inspected = super
|
48
|
-
|
49
|
-
if @private_token
|
50
|
-
inspected = inspected.sub! @private_token, only_show_last_four_chars(@private_token)
|
51
|
-
end
|
52
|
-
|
51
|
+
inspected.sub! @private_token, only_show_last_four_chars(@private_token) if @private_token
|
53
52
|
inspected
|
54
53
|
end
|
55
54
|
|
56
|
-
def url_encode(
|
57
|
-
URI.encode(
|
55
|
+
def url_encode(url)
|
56
|
+
URI.encode(url.to_s, /\W/)
|
58
57
|
end
|
59
58
|
|
60
59
|
private
|
@@ -1,94 +1,101 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
# Gets a list of access requests for a group viewable by the authenticated user.
|
16
|
-
#
|
17
|
-
# @example
|
18
|
-
# Gitlab.group_access_requests(1)
|
19
|
-
#
|
20
|
-
# @param [Integer, String] :group(required) The ID or name of a group.
|
21
|
-
# @return [Array<Gitlab::ObjectifiedHash>] List of group access requests
|
22
|
-
def group_access_requests(group)
|
23
|
-
get("/groups/#{url_encode group}/access_requests")
|
24
|
-
end
|
25
|
-
# Requests access for the authenticated user to a project.
|
26
|
-
#
|
27
|
-
# @example
|
28
|
-
# Gitlab.request_project_access(1)
|
29
|
-
#
|
30
|
-
# @param [Integer, String] :project(required) The ID or name of a project.
|
31
|
-
# @return <Gitlab::ObjectifiedHash] Information about the requested project access
|
32
|
-
def request_project_access(project)
|
33
|
-
post("/projects/#{url_encode project}/access_requests")
|
34
|
-
end
|
35
|
-
# Requests access for the authenticated user to a group.
|
36
|
-
#
|
37
|
-
# @example
|
38
|
-
# Gitlab.request_group_access(1)
|
39
|
-
#
|
40
|
-
# @param [Integer, String] :group(required) The ID or name of a group.
|
41
|
-
# @return <Gitlab::ObjectifiedHash] Information about the requested group access
|
42
|
-
def request_group_access(group)
|
43
|
-
post("/groups/#{url_encode group}/access_requests")
|
44
|
-
end
|
45
|
-
# Approves a project access request for the given user.
|
46
|
-
#
|
47
|
-
# @example
|
48
|
-
# Gitlab.approve_project_access_request(1, 1)
|
49
|
-
# Gitlab.approve_project_access_request(1, 1, {access_level: '30'})
|
50
|
-
#
|
51
|
-
# @param [Integer, String] :project(required) The ID or name of a project.
|
52
|
-
# @param [Integer] :user_id(required) The user ID of the access requester
|
53
|
-
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
54
|
-
# @return <Gitlab::ObjectifiedHash] Information about the approved project access request
|
55
|
-
def approve_project_access_request(project, user_id, options = {})
|
56
|
-
put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
|
57
|
-
end
|
58
|
-
# Approves a group access request for the given user.
|
59
|
-
#
|
60
|
-
# @example
|
61
|
-
# Gitlab.approve_group_access_request(1, 1)
|
62
|
-
# Gitlab.approve_group_access_request(1, 1, {access_level: '30'})
|
63
|
-
#
|
64
|
-
# @param [Integer, String] :group(required) The ID or name of a group.
|
65
|
-
# @param [Integer] :user_id(required) The user ID of the access requester
|
66
|
-
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
67
|
-
# @return <Gitlab::ObjectifiedHash] Information about the approved group access request
|
68
|
-
def approve_group_access_request(group, user_id, options = {})
|
69
|
-
put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
|
70
|
-
end
|
71
|
-
# Denies a project access request for the given user.
|
72
|
-
#
|
73
|
-
# @example
|
74
|
-
# Gitlab.deny_project_access_request(1, 1)
|
75
|
-
#
|
76
|
-
# @param [Integer, String] :project(required) The ID or name of a project.
|
77
|
-
# @param [Integer] :user_id(required) The user ID of the access requester
|
78
|
-
# @return [void] This API call returns an empty response body.
|
79
|
-
def deny_project_access_request(project, user_id)
|
80
|
-
delete("/projects/#{url_encode project}/access_requests/#{user_id}")
|
81
|
-
end
|
82
|
-
# Denies a group access request for the given user.
|
83
|
-
#
|
84
|
-
# @example
|
85
|
-
# Gitlab.deny_group_access_request(1, 1)
|
86
|
-
#
|
87
|
-
# @param [Integer, String] :group(required) The ID or name of a group.
|
88
|
-
# @param [Integer] :user_id(required) The user ID of the access requester
|
89
|
-
# @return [void] This API call returns an empty response body.
|
90
|
-
def deny_group_access_request(group, user_id)
|
91
|
-
delete("/groups/#{url_encode group}/access_requests/#{user_id}")
|
92
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines methods related to Award Emojis.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/access_requests.html
|
5
|
+
module AccessRequests
|
6
|
+
# Gets a list of access requests for a project viewable by the authenticated user.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# Gitlab.project_access_requests(1)
|
10
|
+
#
|
11
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
12
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of project access requests
|
13
|
+
def project_access_requests(project)
|
14
|
+
get("/projects/#{url_encode project}/access_requests")
|
93
15
|
end
|
94
|
-
|
16
|
+
|
17
|
+
# Gets a list of access requests for a group viewable by the authenticated user.
|
18
|
+
#
|
19
|
+
# @example
|
20
|
+
# Gitlab.group_access_requests(1)
|
21
|
+
#
|
22
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
23
|
+
# @return [Array<Gitlab::ObjectifiedHash>] List of group access requests
|
24
|
+
def group_access_requests(group)
|
25
|
+
get("/groups/#{url_encode group}/access_requests")
|
26
|
+
end
|
27
|
+
|
28
|
+
# Requests access for the authenticated user to a project.
|
29
|
+
#
|
30
|
+
# @example
|
31
|
+
# Gitlab.request_project_access(1)
|
32
|
+
#
|
33
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
34
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested project access
|
35
|
+
def request_project_access(project)
|
36
|
+
post("/projects/#{url_encode project}/access_requests")
|
37
|
+
end
|
38
|
+
|
39
|
+
# Requests access for the authenticated user to a group.
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# Gitlab.request_group_access(1)
|
43
|
+
#
|
44
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
45
|
+
# @return <Gitlab::ObjectifiedHash] Information about the requested group access
|
46
|
+
def request_group_access(group)
|
47
|
+
post("/groups/#{url_encode group}/access_requests")
|
48
|
+
end
|
49
|
+
|
50
|
+
# Approves a project access request for the given user.
|
51
|
+
#
|
52
|
+
# @example
|
53
|
+
# Gitlab.approve_project_access_request(1, 1)
|
54
|
+
# Gitlab.approve_project_access_request(1, 1, {access_level: '30'})
|
55
|
+
#
|
56
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
57
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
58
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
59
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved project access request
|
60
|
+
def approve_project_access_request(project, user_id, options = {})
|
61
|
+
put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Approves a group access request for the given user.
|
65
|
+
#
|
66
|
+
# @example
|
67
|
+
# Gitlab.approve_group_access_request(1, 1)
|
68
|
+
# Gitlab.approve_group_access_request(1, 1, {access_level: '30'})
|
69
|
+
#
|
70
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
71
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
72
|
+
# @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
|
73
|
+
# @return <Gitlab::ObjectifiedHash] Information about the approved group access request
|
74
|
+
def approve_group_access_request(group, user_id, options = {})
|
75
|
+
put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
|
76
|
+
end
|
77
|
+
|
78
|
+
# Denies a project access request for the given user.
|
79
|
+
#
|
80
|
+
# @example
|
81
|
+
# Gitlab.deny_project_access_request(1, 1)
|
82
|
+
#
|
83
|
+
# @param [Integer, String] :project(required) The ID or name of a project.
|
84
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
85
|
+
# @return [void] This API call returns an empty response body.
|
86
|
+
def deny_project_access_request(project, user_id)
|
87
|
+
delete("/projects/#{url_encode project}/access_requests/#{user_id}")
|
88
|
+
end
|
89
|
+
|
90
|
+
# Denies a group access request for the given user.
|
91
|
+
#
|
92
|
+
# @example
|
93
|
+
# Gitlab.deny_group_access_request(1, 1)
|
94
|
+
#
|
95
|
+
# @param [Integer, String] :group(required) The ID or name of a group.
|
96
|
+
# @param [Integer] :user_id(required) The user ID of the access requester
|
97
|
+
# @return [void] This API call returns an empty response body.
|
98
|
+
def deny_group_access_request(group, user_id)
|
99
|
+
delete("/groups/#{url_encode group}/access_requests/#{user_id}")
|
100
|
+
end
|
101
|
+
end
|
@@ -1,135 +1,135 @@
|
|
1
|
-
|
2
|
-
# Defines methods related to Award Emojis.
|
3
|
-
# @see https://docs.gitlab.com/ce/api/award_emoji.html
|
4
|
-
module AwardEmojis
|
5
|
-
# Gets a list of all award emoji for an awardable(issue, merge request or snippet)
|
6
|
-
#
|
7
|
-
# @example
|
8
|
-
# Gitlab.award_emojis(1, 80, 'issue')
|
9
|
-
# Gitlab.award_emojis(1, 60, 'merge_request')
|
10
|
-
# Gitlab.award_emojis(1, 40, 'snippet')
|
11
|
-
#
|
12
|
-
# @param [Integer] project The ID of a project.
|
13
|
-
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
14
|
-
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
15
|
-
# @return [Array<Gitlab::ObjectifiedHash>]
|
16
|
-
def award_emojis(project, awardable_id, awardable_type)
|
17
|
-
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji")
|
18
|
-
end
|
1
|
+
# frozen_string_literal: true
|
19
2
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
3
|
+
# Defines methods related to Award Emojis.
|
4
|
+
# @see https://docs.gitlab.com/ce/api/award_emoji.html
|
5
|
+
module AwardEmojis
|
6
|
+
# Gets a list of all award emoji for an awardable(issue, merge request or snippet)
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# Gitlab.award_emojis(1, 80, 'issue')
|
10
|
+
# Gitlab.award_emojis(1, 60, 'merge_request')
|
11
|
+
# Gitlab.award_emojis(1, 40, 'snippet')
|
12
|
+
#
|
13
|
+
# @param [Integer] project The ID of a project.
|
14
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
15
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def award_emojis(project, awardable_id, awardable_type)
|
18
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji")
|
19
|
+
end
|
20
|
+
|
21
|
+
# Gets a list of all award emoji for a single note on an awardable(issue, merge request or snippet)
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.note_award_emojis(1, 80, 'issue', 1)
|
25
|
+
# Gitlab.note_award_emojis(1, 60, 'merge_request', 1)
|
26
|
+
# Gitlab.note_award_emojis(1, 40, 'snippet', 1)
|
27
|
+
#
|
28
|
+
# @param [Integer] project The ID of a project.
|
29
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
30
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
31
|
+
# @param [Integer] note_id The ID of a note.
|
32
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
33
|
+
def note_award_emojis(project, awardable_id, awardable_type, note_id)
|
34
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji")
|
35
|
+
end
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
37
|
+
# Gets a single award emoji for an awardable(issue, merge request or snippet)
|
38
|
+
#
|
39
|
+
# @example
|
40
|
+
# Gitlab.award_emoji(1, 80, 'issue', 4)
|
41
|
+
# Gitlab.award_emoji(1, 60, 'merge_request', 4)
|
42
|
+
# Gitlab.award_emoji(1, 40, 'snippet', 4)
|
43
|
+
#
|
44
|
+
# @param [Integer] project The ID of a project.
|
45
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
46
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
47
|
+
# @param [Integer] award_id The ID of an award emoji.
|
48
|
+
# @return [Gitlab::ObjectifiedHash]
|
49
|
+
def award_emoji(project, awardable_id, awardable_type, award_id)
|
50
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
|
51
|
+
end
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
53
|
+
# Gets a single award emoji from a single note on an awardable(issue, merge request or snippet)
|
54
|
+
#
|
55
|
+
# @example
|
56
|
+
# Gitlab.note_award_emoji(1, 80, 'issue', 1, 4)
|
57
|
+
# Gitlab.note_award_emoji(1, 60, 'merge_request', 1, 4)
|
58
|
+
# Gitlab.note_award_emoji(1, 40, 'snippet', 1, 4)
|
59
|
+
#
|
60
|
+
# @param [Integer] project The ID of a project.
|
61
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
62
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
63
|
+
# @param [Integer] note_id The ID of a note.
|
64
|
+
# @param [Integer] award_id The ID of an award emoji.
|
65
|
+
# @return [Gitlab::ObjectifiedHash]
|
66
|
+
def note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
|
67
|
+
get("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
|
68
|
+
end
|
68
69
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
70
|
+
# Awards a new emoji to an awardable(issue, merge request or snippet)
|
71
|
+
#
|
72
|
+
# @example
|
73
|
+
# Gitlab.create_award_emoji(1, 80, 'issue', 'blowfish')
|
74
|
+
# Gitlab.create_award_emoji(1, 80, 'merge_request', 'blowfish')
|
75
|
+
# Gitlab.create_award_emoji(1, 80, 'snippet', 'blowfish')
|
76
|
+
#
|
77
|
+
# @param [Integer] project The ID of a project.
|
78
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
79
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
80
|
+
# @param [String] emoji_name The name of the emoji, without colons.
|
81
|
+
# @return [Gitlab::ObjectifiedHash]
|
82
|
+
def create_award_emoji(project, awardable_id, awardable_type, emoji_name)
|
83
|
+
post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji", body: { name: emoji_name })
|
84
|
+
end
|
84
85
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
86
|
+
# Awards a new emoji to a note on an awardable(issue, merge request or snippet)
|
87
|
+
#
|
88
|
+
# @example
|
89
|
+
# Gitlab.create_note_award_emoji(1, 80, 'issue', 1, 'blowfish')
|
90
|
+
# Gitlab.create_note_award_emoji(1, 80, 'merge_request', 1, 'blowfish')
|
91
|
+
# Gitlab.create_note_award_emoji(1, 80, 'snippet', 1, 'blowfish')
|
92
|
+
#
|
93
|
+
# @param [Integer] project The ID of a project.
|
94
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
95
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
96
|
+
# @param [Integer] note_id The ID of a note.
|
97
|
+
# @param [String] emoji_name The name of the emoji, without colons.
|
98
|
+
# @return [Gitlab::ObjectifiedHash]
|
99
|
+
def create_note_award_emoji(project, awardable_id, awardable_type, note_id, emoji_name)
|
100
|
+
post("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji", body: { name: emoji_name })
|
101
|
+
end
|
101
102
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
103
|
+
# Deletes a single award emoji from an awardable(issue, merge request or snippet)
|
104
|
+
#
|
105
|
+
# @example
|
106
|
+
# Gitlab.delete_award_emoji(1, 80, 'issue', 4)
|
107
|
+
# Gitlab.delete_award_emoji(1, 60, 'merge_request', 4)
|
108
|
+
# Gitlab.delete_award_emoji(1, 40, 'snippet', 4)
|
109
|
+
#
|
110
|
+
# @param [Integer] project The ID of a project.
|
111
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
112
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
113
|
+
# @param [Integer] award_id The ID of an award emoji.
|
114
|
+
# @return [void] This API call returns an empty response body.
|
115
|
+
def delete_award_emoji(project, awardable_id, awardable_type, award_id)
|
116
|
+
delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/award_emoji/#{award_id}")
|
117
|
+
end
|
117
118
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
end
|
119
|
+
# Deletes a single award emoji from a single note on an awardable(issue, merge request or snippet)
|
120
|
+
#
|
121
|
+
# @example
|
122
|
+
# Gitlab.delete_note_award_emoji(1, 80, 'issue', 1, 4)
|
123
|
+
# Gitlab.delete_note_award_emoji(1, 60, 'merge_request', 1, 4)
|
124
|
+
# Gitlab.delete_note_award_emoji(1, 40, 'snippet', 1, 4)
|
125
|
+
#
|
126
|
+
# @param [Integer] project The ID of a project.
|
127
|
+
# @param [Integer] awardable_id The ID of an awardable(issue, merge request or snippet).
|
128
|
+
# @param [String] awardable_type The type of the awardable(can be 'issue', 'merge_request' or 'snippet')
|
129
|
+
# @param [Integer] note_id The ID of a note.
|
130
|
+
# @param [Integer] award_id The ID of an award emoji.
|
131
|
+
# @return [void] This API call returns an empty response body.
|
132
|
+
def delete_note_award_emoji(project, awardable_id, awardable_type, note_id, award_id)
|
133
|
+
delete("/projects/#{url_encode project}/#{awardable_type}s/#{awardable_id}/notes/#{note_id}/award_emoji/#{award_id}")
|
134
134
|
end
|
135
|
-
end
|
135
|
+
end
|