gitlab 4.5.0 → 4.6.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.
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,88 +1,88 @@
1
- class Gitlab::Client
2
- # Defines methods related to issue boards.
3
- # @see https://docs.gitlab.com/ce/api/boards.html
4
- module Boards
5
- # Gets a list of project's boards.
6
- #
7
- # @example
8
- # Gitlab.boards(5)
9
- # Gitlab.boards({ per_page: 40 })
10
- #
11
- # @param [Integer, String] project The ID or name of a project.
12
- # @param [Hash] options A customizable set of options.
13
- # @option options [Integer] :page The page number.
14
- # @option options [Integer] :per_page The number of results per page.
15
- # @return [Array<Gitlab::ObjectifiedHash>]
16
- def boards(project, options={})
17
- get("/projects/#{url_encode project}/boards", query: options)
18
- end
1
+ # frozen_string_literal: true
19
2
 
20
- # Gets a board lists
21
- #
22
- # @example
23
- # Gitlab.board_lists(5, 42)
24
- #
25
- # @param [Integer, String] project The ID or name of a project.
26
- # @param [Integer] id The ID of a board.
27
- # @return [Gitlab::ObjectifiedHash]
28
- def board_lists(project, id)
29
- get("/projects/#{url_encode project}/boards/#{id}/lists")
30
- end
31
- #
32
- # Gets a single board list
33
- #
34
- # @example
35
- # Gitlab.board_list(5, 42, 25)
36
- #
37
- # @param [Integer, String] project The ID or name of a project.
38
- # @param [Integer] board_id The ID of a board.
39
- # @param [Integer] id The ID of a list.
40
- # @return [Gitlab::ObjectifiedHash]
41
- def board_list(project, board_id, id)
42
- get("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
43
- end
3
+ # Defines methods related to issue boards.
4
+ # @see https://docs.gitlab.com/ce/api/boards.html
5
+ module Boards
6
+ # Gets a list of project's boards.
7
+ #
8
+ # @example
9
+ # Gitlab.boards(5)
10
+ # Gitlab.boards({ per_page: 40 })
11
+ #
12
+ # @param [Integer, String] project The ID or name of a project.
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 boards(project, options = {})
18
+ get("/projects/#{url_encode project}/boards", query: options)
19
+ end
44
20
 
45
- # Creates a new board list.
46
- # Only for admins and project owners
47
- #
48
- # @example
49
- # Gitlab.create_board_list(5, 42, 25)
50
- #
51
- # @param [Integer, String] project The ID or name of a project.
52
- # @param [Integer] id The ID of a board.
53
- # @param [Integer] label_id The ID of a label.
54
- # @return [Gitlab::ObjectifiedHash] Information about created list.
55
- def create_board_list(project, board_id, label_id)
56
- post("/projects/#{url_encode project}/boards/#{board_id}/lists", body: {label_id: label_id})
57
- end
21
+ # Gets a board lists
22
+ #
23
+ # @example
24
+ # Gitlab.board_lists(5, 42)
25
+ #
26
+ # @param [Integer, String] project The ID or name of a project.
27
+ # @param [Integer] id The ID of a board.
28
+ # @return [Gitlab::ObjectifiedHash]
29
+ def board_lists(project, id)
30
+ get("/projects/#{url_encode project}/boards/#{id}/lists")
31
+ end
58
32
 
59
- # Updates a board list.
60
- # Only for admins and project owners
61
- #
62
- # @example
63
- # Gitlab.edit_board_list(6, 1, 12, 5)
64
- #
65
- # @param [Integer, String] project The ID or name of a project.
66
- # @param [Integer] board_id The ID of a board.
67
- # @param [Integer] id The ID of a list.
68
- # @return [Gitlab::ObjectifiedHash] Information about updated board list.
69
- def edit_board_list(project, board_id, id, position)
70
- put("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}", body: {position: position})
71
- end
33
+ #
34
+ # Gets a single board list
35
+ #
36
+ # @example
37
+ # Gitlab.board_list(5, 42, 25)
38
+ #
39
+ # @param [Integer, String] project The ID or name of a project.
40
+ # @param [Integer] board_id The ID of a board.
41
+ # @param [Integer] id The ID of a list.
42
+ # @return [Gitlab::ObjectifiedHash]
43
+ def board_list(project, board_id, id)
44
+ get("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
45
+ end
72
46
 
73
- # Deletes a board list.
74
- # Only for admins and project owners
75
- #
76
- # @example
77
- # Gitlab.delete_board_list(3, 42, 32)
78
- #
79
- # @param [Integer, String] project The ID or name of a project.
80
- # @param [Integer] board_id The ID of a board.
81
- # @param [Integer] id The ID of a list.
82
- # @return [Gitlab::ObjectifiedHash] Information about deleted board list.
83
- def delete_board_list(project, board_id, id)
84
- delete("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
85
- end
47
+ # Creates a new board list.
48
+ # Only for admins and project owners
49
+ #
50
+ # @example
51
+ # Gitlab.create_board_list(5, 42, 25)
52
+ #
53
+ # @param [Integer, String] project The ID or name of a project.
54
+ # @param [Integer] id The ID of a board.
55
+ # @param [Integer] label_id The ID of a label.
56
+ # @return [Gitlab::ObjectifiedHash] Information about created list.
57
+ def create_board_list(project, board_id, label_id)
58
+ post("/projects/#{url_encode project}/boards/#{board_id}/lists", body: { label_id: label_id })
86
59
  end
87
- end
88
60
 
61
+ # Updates a board list.
62
+ # Only for admins and project owners
63
+ #
64
+ # @example
65
+ # Gitlab.edit_board_list(6, 1, 12, 5)
66
+ #
67
+ # @param [Integer, String] project The ID or name of a project.
68
+ # @param [Integer] board_id The ID of a board.
69
+ # @param [Integer] id The ID of a list.
70
+ # @return [Gitlab::ObjectifiedHash] Information about updated board list.
71
+ def edit_board_list(project, board_id, id, position)
72
+ put("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}", body: { position: position })
73
+ end
74
+
75
+ # Deletes a board list.
76
+ # Only for admins and project owners
77
+ #
78
+ # @example
79
+ # Gitlab.delete_board_list(3, 42, 32)
80
+ #
81
+ # @param [Integer, String] project The ID or name of a project.
82
+ # @param [Integer] board_id The ID of a board.
83
+ # @param [Integer] id The ID of a list.
84
+ # @return [Gitlab::ObjectifiedHash] Information about deleted board list.
85
+ def delete_board_list(project, board_id, id)
86
+ delete("/projects/#{url_encode project}/boards/#{board_id}/lists/#{id}")
87
+ end
88
+ end
@@ -1,96 +1,96 @@
1
- class Gitlab::Client
2
- # Defines methods related to repositories.
3
- # @see https://docs.gitlab.com/ce/api/branches.html
4
- module Branches
5
- # Gets a list of project repositiory branches.
6
- #
7
- # @example
8
- # Gitlab.branches(42)
9
- #
10
- # @param [Integer, String] project The ID or name of a project.
11
- # @param [Hash] options A customizable set of options.
12
- # @option options [Integer] :page The page number.
13
- # @option options [Integer] :per_page The number of results per page.
14
- # @return [Array<Gitlab::ObjectifiedHash>]
15
- def branches(project, options={})
16
- get("/projects/#{url_encode project}/repository/branches", query: options)
17
- end
18
- alias_method :repo_branches, :branches
1
+ # frozen_string_literal: true
19
2
 
20
- # Gets information about a repository branch.
21
- #
22
- # @example
23
- # Gitlab.branch(3, 'api')
24
- # Gitlab.repo_branch(5, 'master')
25
- #
26
- # @param [Integer, String] project The ID or name of a project.
27
- # @param [String] branch The name of the branch.
28
- # @return [Gitlab::ObjectifiedHash]
29
- def branch(project, branch)
30
- get("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
31
- end
32
- alias_method :repo_branch, :branch
3
+ # Defines methods related to repositories.
4
+ # @see https://docs.gitlab.com/ce/api/branches.html
5
+ module Branches
6
+ # Gets a list of project repositiory branches.
7
+ #
8
+ # @example
9
+ # Gitlab.branches(42)
10
+ #
11
+ # @param [Integer, String] project The ID or name of a project.
12
+ # @param [Hash] options A customizable set of options.
13
+ # @option options [Integer] :page The page number.
14
+ # @option options [Integer] :per_page The number of results per page.
15
+ # @return [Array<Gitlab::ObjectifiedHash>]
16
+ def branches(project, options = {})
17
+ get("/projects/#{url_encode project}/repository/branches", query: options)
18
+ end
19
+ alias repo_branches branches
20
+
21
+ # Gets information about a repository branch.
22
+ #
23
+ # @example
24
+ # Gitlab.branch(3, 'api')
25
+ # Gitlab.repo_branch(5, 'master')
26
+ #
27
+ # @param [Integer, String] project The ID or name of a project.
28
+ # @param [String] branch The name of the branch.
29
+ # @return [Gitlab::ObjectifiedHash]
30
+ def branch(project, branch)
31
+ get("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
32
+ end
33
+ alias repo_branch branch
33
34
 
34
- # Protects a repository branch.
35
- #
36
- # @example
37
- # Gitlab.protect_branch(3, 'api')
38
- # Gitlab.repo_protect_branch(5, 'master')
39
- # Gitlab.protect_branch(5, 'api', developers_can_push: true)
40
- #
41
- # To update options, call `protect_branch` again with new options (i.e. `developers_can_push: false`)
42
- #
43
- # @param [Integer, String] project The ID or name of a project.
44
- # @param [String] branch The name of the branch.
45
- # @param [Hash] options A customizable set of options.
46
- # @option options [Boolean] :developers_can_push True to allow developers to push to the branch (default = false)
47
- # @option options [Boolean] :developers_can_merge True to allow developers to merge into the branch (default = false)
48
- # @return [Gitlab::ObjectifiedHash] Details about the branch
49
- def protect_branch(project, branch, options = {})
50
- post("/projects/#{url_encode project}/protected_branches", body: {name: branch}.merge(options))
51
- end
52
- alias_method :repo_protect_branch, :protect_branch
35
+ # Protects a repository branch.
36
+ #
37
+ # @example
38
+ # Gitlab.protect_branch(3, 'api')
39
+ # Gitlab.repo_protect_branch(5, 'master')
40
+ # Gitlab.protect_branch(5, 'api', developers_can_push: true)
41
+ #
42
+ # To update options, call `protect_branch` again with new options (i.e. `developers_can_push: false`)
43
+ #
44
+ # @param [Integer, String] project The ID or name of a project.
45
+ # @param [String] branch The name of the branch.
46
+ # @param [Hash] options A customizable set of options.
47
+ # @option options [Boolean] :developers_can_push True to allow developers to push to the branch (default = false)
48
+ # @option options [Boolean] :developers_can_merge True to allow developers to merge into the branch (default = false)
49
+ # @return [Gitlab::ObjectifiedHash] Details about the branch
50
+ def protect_branch(project, branch, options = {})
51
+ post("/projects/#{url_encode project}/protected_branches", body: { name: branch }.merge(options))
52
+ end
53
+ alias repo_protect_branch protect_branch
53
54
 
54
- # Unprotects a repository branch.
55
- #
56
- # @example
57
- # Gitlab.unprotect_branch(3, 'api')
58
- # Gitlab.repo_unprotect_branch(5, 'master')
59
- #
60
- # @param [Integer, String] project The ID or name of a project.
61
- # @param [String] branch The name of the branch.
62
- # @return [Gitlab::ObjectifiedHash] Details about the branch
63
- def unprotect_branch(project, branch)
64
- delete("/projects/#{url_encode project}/protected_branches/#{url_encode branch}")
65
- end
66
- alias_method :repo_unprotect_branch, :unprotect_branch
55
+ # Unprotects a repository branch.
56
+ #
57
+ # @example
58
+ # Gitlab.unprotect_branch(3, 'api')
59
+ # Gitlab.repo_unprotect_branch(5, 'master')
60
+ #
61
+ # @param [Integer, String] project The ID or name of a project.
62
+ # @param [String] branch The name of the branch.
63
+ # @return [Gitlab::ObjectifiedHash] Details about the branch
64
+ def unprotect_branch(project, branch)
65
+ delete("/projects/#{url_encode project}/protected_branches/#{url_encode branch}")
66
+ end
67
+ alias repo_unprotect_branch unprotect_branch
67
68
 
68
- # Creates a repository branch. Requires Gitlab >= 6.8.x
69
- #
70
- # @example
71
- # Gitlab.create_branch(3, 'api', 'feat/new-api')
72
- # Gitlab.repo_create_branch(5, 'master', 'develop')
73
- #
74
- # @param [Integer, String] project The ID or name of a project.
75
- # @param [String] branch The name of the new branch.
76
- # @param [String] ref Create branch from commit sha or existing branch
77
- # @return [Gitlab::ObjectifiedHash] Details about the branch
78
- def create_branch(project, branch, ref)
79
- post("/projects/#{url_encode project}/repository/branches", query: { branch: branch, ref: ref })
80
- end
81
- alias_method :repo_create_branch, :create_branch
69
+ # Creates a repository branch. Requires Gitlab >= 6.8.x
70
+ #
71
+ # @example
72
+ # Gitlab.create_branch(3, 'api', 'feat/new-api')
73
+ # Gitlab.repo_create_branch(5, 'master', 'develop')
74
+ #
75
+ # @param [Integer, String] project The ID or name of a project.
76
+ # @param [String] branch The name of the new branch.
77
+ # @param [String] ref Create branch from commit sha or existing branch
78
+ # @return [Gitlab::ObjectifiedHash] Details about the branch
79
+ def create_branch(project, branch, ref)
80
+ post("/projects/#{url_encode project}/repository/branches", query: { branch: branch, ref: ref })
81
+ end
82
+ alias repo_create_branch create_branch
82
83
 
83
- # Deletes a repository branch. Requires Gitlab >= 6.8.x
84
- #
85
- # @example
86
- # Gitlab.delete_branch(3, 'api')
87
- # Gitlab.repo_delete_branch(5, 'master')
88
- #
89
- # @param [Integer, String] project The ID or name of a project.
90
- # @param [String] branch The name of the branch to delete
91
- def delete_branch(project, branch)
92
- delete("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
93
- end
94
- alias_method :repo_delete_branch, :delete_branch
84
+ # Deletes a repository branch. Requires Gitlab >= 6.8.x
85
+ #
86
+ # @example
87
+ # Gitlab.delete_branch(3, 'api')
88
+ # Gitlab.repo_delete_branch(5, 'master')
89
+ #
90
+ # @param [Integer, String] project The ID or name of a project.
91
+ # @param [String] branch The name of the branch to delete
92
+ def delete_branch(project, branch)
93
+ delete("/projects/#{url_encode project}/repository/branches/#{url_encode branch}")
95
94
  end
95
+ alias repo_delete_branch delete_branch
96
96
  end
@@ -1,128 +1,128 @@
1
- class Gitlab::Client
2
- # Defines methods related to builds.
3
- # @see https://docs.gitlab.com/ce/api/build_variables.html
4
- # @see https://docs.gitlab.com/ee/api/group_level_variables.html
5
- module BuildVariables
6
- # Gets a list of the project's build variables
7
- #
8
- # @example
9
- # Gitlab.variables(5)
10
- #
11
- # @param [Integer, String] project The ID or name of a project.
12
- # @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
13
- def variables(project)
14
- get("/projects/#{url_encode project}/variables")
15
- end
1
+ # frozen_string_literal: true
16
2
 
17
- # Gets details of a project's specific build variable.
18
- #
19
- # @example
20
- # Gitlab.variable(5, "TEST_VARIABLE_1")
21
- #
22
- # @param [Integer, String] project The ID or name of a project.
23
- # @param [String] key The key of a variable.
24
- # @return [Gitlab::ObjectifiedHash] The variable.
25
- def variable(project, key)
26
- get("/projects/#{url_encode project}/variables/#{key}")
27
- end
3
+ # Defines methods related to builds.
4
+ # @see https://docs.gitlab.com/ce/api/build_variables.html
5
+ # @see https://docs.gitlab.com/ee/api/group_level_variables.html
6
+ module BuildVariables
7
+ # Gets a list of the project's build variables
8
+ #
9
+ # @example
10
+ # Gitlab.variables(5)
11
+ #
12
+ # @param [Integer, String] project The ID or name of a project.
13
+ # @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
14
+ def variables(project)
15
+ get("/projects/#{url_encode project}/variables")
16
+ end
28
17
 
29
- # Create a build variable for a project.
30
- #
31
- # @example
32
- # Gitlab.create_variable(5, "NEW_VARIABLE", "new value")
33
- #
34
- # @param [Integer, String] project The ID or name of a project.
35
- # @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
36
- # @param [String] value The value of a variable
37
- # @return [Gitlab::ObjectifiedHash] The variable.
38
- def create_variable(project, key, value)
39
- post("/projects/#{url_encode project}/variables", body: { key: key, value: value })
40
- end
18
+ # Gets details of a project's specific build variable.
19
+ #
20
+ # @example
21
+ # Gitlab.variable(5, "TEST_VARIABLE_1")
22
+ #
23
+ # @param [Integer, String] project The ID or name of a project.
24
+ # @param [String] key The key of a variable.
25
+ # @return [Gitlab::ObjectifiedHash] The variable.
26
+ def variable(project, key)
27
+ get("/projects/#{url_encode project}/variables/#{key}")
28
+ end
41
29
 
42
- # Update a project's build variable.
43
- #
44
- # @example
45
- # Gitlab.update_variable(5, "NEW_VARIABLE", "updated value")
46
- #
47
- # @param [Integer, String] project The ID or name of a project.
48
- # @param [String] key The key of a variable
49
- # @param [String] value The value of a variable
50
- # @return [Gitlab::ObjectifiedHash] The variable.
51
- def update_variable(project, key, value)
52
- put("/projects/#{url_encode project}/variables/#{key}", body: { value: value })
53
- end
30
+ # Create a build variable for a project.
31
+ #
32
+ # @example
33
+ # Gitlab.create_variable(5, "NEW_VARIABLE", "new value")
34
+ #
35
+ # @param [Integer, String] project The ID or name of a project.
36
+ # @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
37
+ # @param [String] value The value of a variable
38
+ # @return [Gitlab::ObjectifiedHash] The variable.
39
+ def create_variable(project, key, value)
40
+ post("/projects/#{url_encode project}/variables", body: { key: key, value: value })
41
+ end
42
+
43
+ # Update a project's build variable.
44
+ #
45
+ # @example
46
+ # Gitlab.update_variable(5, "NEW_VARIABLE", "updated value")
47
+ #
48
+ # @param [Integer, String] project The ID or name of a project.
49
+ # @param [String] key The key of a variable
50
+ # @param [String] value The value of a variable
51
+ # @return [Gitlab::ObjectifiedHash] The variable.
52
+ def update_variable(project, key, value)
53
+ put("/projects/#{url_encode project}/variables/#{key}", body: { value: value })
54
+ end
54
55
 
55
- # Remove a project's build variable.
56
- #
57
- # @example
58
- # Gitlab.remove_variable(5, "VARIABLE_1")
59
- #
60
- # @param [Integer, String] project The ID or name of a project.
61
- # @param [String] key The key of a variable.
62
- # @return [Gitlab::ObjectifiedHash] The variable.
63
- def remove_variable(project, key)
64
- delete("/projects/#{url_encode project}/variables/#{key}")
65
- end
56
+ # Remove a project's build variable.
57
+ #
58
+ # @example
59
+ # Gitlab.remove_variable(5, "VARIABLE_1")
60
+ #
61
+ # @param [Integer, String] project The ID or name of a project.
62
+ # @param [String] key The key of a variable.
63
+ # @return [Gitlab::ObjectifiedHash] The variable.
64
+ def remove_variable(project, key)
65
+ delete("/projects/#{url_encode project}/variables/#{key}")
66
+ end
66
67
 
67
- # Gets a list of the group's build variables
68
- #
69
- # @example
70
- # Gitlab.group_variables(5)
71
- #
72
- # @param [Integer, String] group The ID or name of a group.
73
- # @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
74
- def group_variables(group)
75
- get("/groups/#{url_encode group}/variables")
76
- end
68
+ # Gets a list of the group's build variables
69
+ #
70
+ # @example
71
+ # Gitlab.group_variables(5)
72
+ #
73
+ # @param [Integer, String] group The ID or name of a group.
74
+ # @return [Array<Gitlab::ObjectifiedHash>] The list of variables.
75
+ def group_variables(group)
76
+ get("/groups/#{url_encode group}/variables")
77
+ end
77
78
 
78
- # Gets details of a group's specific build variable.
79
- #
80
- # @example
81
- # Gitlab.group_variable(5, "TEST_VARIABLE_1")
82
- #
83
- # @param [Integer, String] group The ID or name of a group.
84
- # @param [String] key The key of a variable.
85
- # @return [Gitlab::ObjectifiedHash] The variable.
86
- def group_variable(group, key)
87
- get("/groups/#{url_encode group}/variables/#{key}")
88
- end
79
+ # Gets details of a group's specific build variable.
80
+ #
81
+ # @example
82
+ # Gitlab.group_variable(5, "TEST_VARIABLE_1")
83
+ #
84
+ # @param [Integer, String] group The ID or name of a group.
85
+ # @param [String] key The key of a variable.
86
+ # @return [Gitlab::ObjectifiedHash] The variable.
87
+ def group_variable(group, key)
88
+ get("/groups/#{url_encode group}/variables/#{key}")
89
+ end
89
90
 
90
- # Create a build variable for a group.
91
- #
92
- # @example
93
- # Gitlab.create_group_variable(5, "NEW_VARIABLE", "new value")
94
- #
95
- # @param [Integer, String] group The ID or name of a group.
96
- # @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
97
- # @param [String] value The value of a variable
98
- # @return [Gitlab::ObjectifiedHash] The variable.
99
- def create_group_variable(group, key, value)
100
- post("/groups/#{url_encode group}/variables", body: { key: key, value: value })
101
- end
91
+ # Create a build variable for a group.
92
+ #
93
+ # @example
94
+ # Gitlab.create_group_variable(5, "NEW_VARIABLE", "new value")
95
+ #
96
+ # @param [Integer, String] group The ID or name of a group.
97
+ # @param [String] key The key of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9` and `_` are allowed
98
+ # @param [String] value The value of a variable
99
+ # @return [Gitlab::ObjectifiedHash] The variable.
100
+ def create_group_variable(group, key, value)
101
+ post("/groups/#{url_encode group}/variables", body: { key: key, value: value })
102
+ end
102
103
 
103
- # Update a group's build variable.
104
- #
105
- # @example
106
- # Gitlab.update_group_variable(5, "NEW_VARIABLE", "updated value")
107
- #
108
- # @param [Integer, String] group The ID or name of a group.
109
- # @param [String] key The key of a variable
110
- # @param [String] value The value of a variable
111
- # @return [Gitlab::ObjectifiedHash] The variable.
112
- def update_group_variable(group, key, value)
113
- put("/groups/#{url_encode group}/variables/#{key}", body: { value: value })
114
- end
104
+ # Update a group's build variable.
105
+ #
106
+ # @example
107
+ # Gitlab.update_group_variable(5, "NEW_VARIABLE", "updated value")
108
+ #
109
+ # @param [Integer, String] group The ID or name of a group.
110
+ # @param [String] key The key of a variable
111
+ # @param [String] value The value of a variable
112
+ # @return [Gitlab::ObjectifiedHash] The variable.
113
+ def update_group_variable(group, key, value)
114
+ put("/groups/#{url_encode group}/variables/#{key}", body: { value: value })
115
+ end
115
116
 
116
- # Remove a group's build variable.
117
- #
118
- # @example
119
- # Gitlab.remove_group_variable(5, "VARIABLE_1")
120
- #
121
- # @param [Integer, String] group The ID or name of a group.
122
- # @param [String] key The key of a variable.
123
- # @return [Gitlab::ObjectifiedHash] The variable.
124
- def remove_group_variable(group, key)
125
- delete("/groups/#{url_encode group}/variables/#{key}")
126
- end
117
+ # Remove a group's build variable.
118
+ #
119
+ # @example
120
+ # Gitlab.remove_group_variable(5, "VARIABLE_1")
121
+ #
122
+ # @param [Integer, String] group The ID or name of a group.
123
+ # @param [String] key The key of a variable.
124
+ # @return [Gitlab::ObjectifiedHash] The variable.
125
+ def remove_group_variable(group, key)
126
+ delete("/groups/#{url_encode group}/variables/#{key}")
127
127
  end
128
128
  end