gitlab 4.9.0 → 4.13.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6829c32454f11e11d6b7b3b15dbebaeda3b439ac5b21b6a47bf52526dc742237
4
- data.tar.gz: bfb53a22f9838c806ae52cac72fa65abde209c6dd09baea4308587e24a0d9aa3
3
+ metadata.gz: b2504adea709074810ff6508709ad14415fe1084dee353f3bd2ca53757220ba8
4
+ data.tar.gz: 2783c2afff1b5aa5898d1be19e29124ea1cddcf79fedbaae003c9066cb97116e
5
5
  SHA512:
6
- metadata.gz: 8084547f4db3b39bbd1fb477d8a8e79dea2c73f6490551d0dfd77e685628ac57aabd8e02dca188898b7a1c04dd0083bfde9682767beb993fe86cd28522b268af
7
- data.tar.gz: 2a7cd1d37840894dcb1e5653b565993beba6109f11961f2ddf3930739244151887cf40e28bcddad2e0394ff25610fadabd19ad63d3fbc8755112c548267bdbff
6
+ metadata.gz: 415a2de181363d3a0612c78a94dfa7c13f3c812f6a1a214ab910cfc92927ba414eabeba07b52bb7469c67cd91f03bc42422a676c7026bbfd414c250377d04ce0
7
+ data.tar.gz: abe3f75d8d8bd649a10004de7ba09179b0e135c4b604bf32c237d53a60516566778e95e4ee7f2368f5fe8bbf077df15cc93426b7a77582985fa243d039dd1d1a
data/README.md CHANGED
@@ -7,11 +7,11 @@
7
7
  [![License](https://img.shields.io/badge/license-BSD-red.svg)](https://github.com/NARKOZ/gitlab/blob/master/LICENSE.txt)
8
8
 
9
9
  [website](https://narkoz.github.io/gitlab) |
10
- [documentation](https://rubydoc.info/gems/gitlab/frames) |
10
+ [documentation](https://www.rubydoc.info/gems/gitlab/frames) |
11
11
  [gitlab-live](https://github.com/NARKOZ/gitlab-live)
12
12
 
13
13
  Gitlab is a Ruby wrapper and CLI for the [GitLab API](https://docs.gitlab.com/ce/api/README.html).
14
- As of version `4.0.0` this gem only supports Ruby 2.0+ and GitLab API v4.
14
+ As of version `4.0.0` this gem only supports GitLab API v4.
15
15
 
16
16
  ## Installation
17
17
 
@@ -40,7 +40,7 @@ Configuration example:
40
40
 
41
41
  ```ruby
42
42
  Gitlab.configure do |config|
43
- config.endpoint = 'https://example.net/api/v4' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
43
+ config.endpoint = 'https://example.net/api/v4' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT'] and falls back to ENV['CI_API_V4_URL']
44
44
  config.private_token = 'qEsq1pt6HJPaNciie3MG' # user's private token or OAuth2 access token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
45
45
  # Optional
46
46
  # config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'
@@ -72,8 +72,14 @@ ENV['GITLAB_API_HTTPARTY_OPTIONS'] = '{read_timeout: 60}'
72
72
  Gitlab.projects(per_page: 5)
73
73
  # => [#<Gitlab::ObjectifiedHash:0x000000023326e0 @data={"id"=>1, "code"=>"brute", "name"=>"Brute", "description"=>nil, "path"=>"brute", "default_branch"=>nil, "owner"=>#<Gitlab::ObjectifiedHash:0x00000002331600 @data={"id"=>1, "email"=>"john@example.com", "name"=>"John Smith", "blocked"=>false, "created_at"=>"2012-09-17T09:41:56Z"}>, "private"=>true, "issues_enabled"=>true, "merge_requests_enabled"=>true, "wall_enabled"=>true, "wiki_enabled"=>true, "created_at"=>"2012-09-17T09:41:56Z"}>, #<Gitlab::ObjectifiedHash:0x000000023450d8 @data={"id"=>2, "code"=>"mozart", "name"=>"Mozart", "description"=>nil, "path"=>"mozart", "default_branch"=>nil, "owner"=>#<Gitlab::ObjectifiedHash:0x00000002344ca0 @data={"id"=>1, "email"=>"john@example.com", "name"=>"John Smith", "blocked"=>false, "created_at"=>"2012-09-17T09:41:56Z"}>, "private"=>true, "issues_enabled"=>true, "merge_requests_enabled"=>true, "wall_enabled"=>true, "wiki_enabled"=>true, "created_at"=>"2012-09-17T09:41:57Z"}>, #<Gitlab::ObjectifiedHash:0x00000002344958 @data={"id"=>3, "code"=>"gitlab", "name"=>"Gitlab", "description"=>nil, "path"=>"gitlab", "default_branch"=>nil, "owner"=>#<Gitlab::ObjectifiedHash:0x000000023447a0 @data={"id"=>1, "email"=>"john@example.com", "name"=>"John Smith", "blocked"=>false, "created_at"=>"2012-09-17T09:41:56Z"}>, "private"=>true, "issues_enabled"=>true, "merge_requests_enabled"=>true, "wall_enabled"=>true, "wiki_enabled"=>true, "created_at"=>"2012-09-17T09:41:58Z"}>]
74
74
 
75
- # initialize a new client
76
- g = Gitlab.client(endpoint: 'https://api.example.com', private_token: 'qEsq1pt6HJPaNciie3MG')
75
+ # initialize a new client with custom headers
76
+ g = Gitlab.client(
77
+ endpoint: 'https://example.com/api/v4',
78
+ private_token: 'qEsq1pt6HJPaNciie3MG',
79
+ httparty: {
80
+ headers: { 'Cookie' => 'gitlab_canary=true' }
81
+ }
82
+ )
77
83
  # => #<Gitlab::Client:0x00000001e62408 @endpoint="https://api.example.com", @private_token="qEsq1pt6HJPaNciie3MG", @user_agent="Gitlab Ruby Gem 2.0.0">
78
84
 
79
85
  # get a user
@@ -110,7 +116,7 @@ end
110
116
  projects.auto_paginate
111
117
  ```
112
118
 
113
- For more information, refer to [documentation](https://rubydoc.info/gems/gitlab/frames).
119
+ For more information, refer to [documentation](https://www.rubydoc.info/gems/gitlab/frames).
114
120
 
115
121
  ## CLI
116
122
 
@@ -8,9 +8,6 @@ require_relative 'shell'
8
8
  class Gitlab::CLI
9
9
  extend Helpers
10
10
 
11
- # If set to true, JSON will be rendered as output
12
- @render_json = false
13
-
14
11
  # Starts a new CLI session.
15
12
  #
16
13
  # @example
@@ -39,22 +39,23 @@ class Gitlab::CLI
39
39
  #
40
40
  # @return [Array]
41
41
  def required_fields(args)
42
- if args.any? && args.last.is_a?(String) && args.last.start_with?('--only=')
43
- args.last.gsub('--only=', '').split(',')
44
- else
45
- []
46
- end
42
+ filtered_fields(args, '--only=')
47
43
  end
48
44
 
49
45
  # Returns filtered excluded fields.
50
46
  #
51
47
  # @return [Array]
52
48
  def excluded_fields(args)
53
- if args.any? && args.last.is_a?(String) && args.last.start_with?('--except=')
54
- args.last.gsub('--except=', '').split(',')
55
- else
56
- []
57
- end
49
+ filtered_fields(args, '--except=')
50
+ end
51
+
52
+ # Returns fields filtered by a keyword.
53
+ #
54
+ # @return [Array]
55
+ def filtered_fields(args, key)
56
+ return [] unless args.any? && args.last.is_a?(String) && args.last.start_with?(key)
57
+
58
+ args.last.gsub(key, '').split(',')
58
59
  end
59
60
 
60
61
  # Confirms command is valid.
@@ -7,6 +7,8 @@ module Gitlab
7
7
 
8
8
  # Please keep in alphabetical order
9
9
  include AccessRequests
10
+ include ApplicationSettings
11
+ include Avatar
10
12
  include AwardEmojis
11
13
  include Boards
12
14
  include Branches
@@ -14,16 +16,23 @@ module Gitlab
14
16
  include BuildVariables
15
17
  include Builds
16
18
  include Commits
19
+ include ContainerRegistry
17
20
  include Deployments
18
21
  include Environments
22
+ include Epics
19
23
  include Events
20
24
  include Features
25
+ include GroupBoards
26
+ include GroupLabels
21
27
  include GroupMilestones
22
28
  include Groups
29
+ include IssueLinks
23
30
  include Issues
24
31
  include Jobs
25
32
  include Keys
26
33
  include Labels
34
+ include Lint
35
+ include Markdown
27
36
  include MergeRequestApprovals
28
37
  include MergeRequests
29
38
  include Milestones
@@ -43,6 +52,7 @@ module Gitlab
43
52
  include RepositorySubmodules
44
53
  include ResourceLabelEvents
45
54
  include Runners
55
+ include Search
46
56
  include Services
47
57
  include Sidekiq
48
58
  include Snippets
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Gitlab::Client
4
+ # Defines methods related to application settings.
5
+ # @see https://docs.gitlab.com/ee/api/settings.html
6
+ module ApplicationSettings
7
+ # Retrives the application settings of Gitlab.
8
+ #
9
+ # @example
10
+ # Gitlab.application_settings
11
+ #
12
+ # @return [Array<Gitlab::ObjectifiedHash>]
13
+ def application_settings
14
+ get('/application/settings')
15
+ end
16
+
17
+ # Edit the applications settings of Gitlab.
18
+ #
19
+ # @example
20
+ # Gitlab.edit_application_settings({ signup_enabled: false })
21
+ #
22
+ # @param [Hash] options A customizable set of options.
23
+ # @option options [String] :admin_notification_email
24
+ # @option options [String] :after_sign_out_path
25
+ # @option options [String] :after_sign_up_text
26
+ # @option options [String] :akismet_api_key
27
+ # @option options [Boolean] :akismet_enabled
28
+ # @option options [Boolean] :allow_group_owners_to_manage_ldap
29
+ # @option options [Boolean] :allow_local_requests_from_hooks_and_services
30
+ # @option options [Boolean] :authorized_keys_enabled
31
+ # @option options [String] :auto_devops_domain
32
+ # @option options [Boolean] :auto_devops_enabled
33
+ # @option options [Boolean] :check_namespace_plan
34
+ # @option options [String] :clientside_sentry_dsn
35
+ # @option options [Boolean] :clientside_sentry_enabled
36
+ # @option options [Integer] :container_registry_token_expire_delay
37
+ # @option options [String] :default_artifacts_expire_in
38
+ # @option options [Integer] :default_branch_protection
39
+ # @option options [String] :default_group_visibility
40
+ # @option options [String] :default_project_visibility
41
+ # @option options [Integer] :default_projects_limit
42
+ # @option options [String] :default_snippet_visibility
43
+ # @option options [Array<String>] :disabled_oauth_sign_in_sources
44
+ # @option options [Array<String>] :domain_blacklist
45
+ # @option options [Boolean] :domain_blacklist_enabled
46
+ # @option options [Array<String>] :domain_whitelist
47
+ # @option options [Integer] :dsa_key_restriction
48
+ # @option options [Integer] :ecdsa_key_restriction
49
+ # @option options [Integer] :ed25519_key_restriction
50
+ # @option options [Boolean] :elasticsearch_aws
51
+ # @option options [String] :elasticsearch_aws_access_key
52
+ # @option options [String] :elasticsearch_aws_region
53
+ # @option options [String] :elasticsearch_aws_secret_access_key
54
+ # @option options [Boolean] :elasticsearch_experimental_indexer
55
+ # @option options [Boolean] :elasticsearch_indexing
56
+ # @option options [Boolean] :elasticsearch_search
57
+ # @option options [String] :elasticsearch_url
58
+ # @option options [Boolean] :elasticsearch_limit_indexing
59
+ # @option options [Array<Integer>] :elasticsearch_project_ids
60
+ # @option options [Array<Integer>] :elasticsearch_namespace_ids
61
+ # @option options [String] :email_additional_text
62
+ # @option options [Boolean] :email_author_in_body
63
+ # @option options [String] :enabled_git_access_protocol
64
+ # @option options [Boolean] :enforce_terms
65
+ # @option options [String] :external_auth_client_cert
66
+ # @option options [String] :external_auth_client_key
67
+ # @option options [String] :external_auth_client_key_pass
68
+ # @option options [Boolean] :external_authorization_service_enabled
69
+ # @option options [String] :external_authorization_service_default_label
70
+ # @option options [Float] :external_authorization_service_timeout float
71
+ # @option options [String] :external_authorization_service_url
72
+ # @option options [Integer] :file_template_project_id
73
+ # @option options [Integer] :first_day_of_week
74
+ # @option options [Integer] :geo_status_timeout
75
+ # @option options [Integer] :gitaly_timeout_default
76
+ # @option options [Integer] :gitaly_timeout_fast
77
+ # @option options [Integer] :gitaly_timeout_medium
78
+ # @option options [Boolean] :gravatar_enabled
79
+ # @option options [Boolean] :hashed_storage_enabled
80
+ # @option options [Boolean] :help_page_hide_commercial_content
81
+ # @option options [String] :help_page_support_url
82
+ # @option options [String] :help_page_text
83
+ # @option options [String] :help_text
84
+ # @option options [Boolean] :hide_third_party_offers
85
+ # @option options [String] :home_page_url
86
+ # @option options [Boolean] :housekeeping_bitmaps_enabled
87
+ # @option options [Boolean] :housekeeping_enabled
88
+ # @option options [Integer] :housekeeping_full_repack_period
89
+ # @option options [Integer] :housekeeping_gc_period
90
+ # @option options [Integer] :housekeeping_incremental_repack_period
91
+ # @option options [Boolean] :html_emails_enabled
92
+ # @option options [Boolean] :instance_statistics_visibility_private
93
+ # @option options [Array<String>] :import_sources
94
+ # @option options [Integer] :max_artifacts_size
95
+ # @option options [Integer] :max_attachment_size
96
+ # @option options [Integer] :max_pages_size
97
+ # @option options [Boolean] :metrics_enabled
98
+ # @option options [String] :metrics_host
99
+ # @option options [Integer] :metrics_method_call_threshold
100
+ # @option options [Integer] :metrics_packet_size
101
+ # @option options [Integer] :metrics_pool_size
102
+ # @option options [Integer] :metrics_port
103
+ # @option options [Integer] :metrics_sample_interval
104
+ # @option options [Integer] :metrics_timeout
105
+ # @option options [Boolean] :mirror_available
106
+ # @option options [Integer] :mirror_capacity_threshold
107
+ # @option options [Integer] :mirror_max_capacity
108
+ # @option options [Integer] :mirror_max_delay
109
+ # @option options [Boolean] :pages_domain_verification_enabled
110
+ # @option options [Boolean] :password_authentication_enabled_for_git
111
+ # @option options [Boolean] :password_authentication_enabled_for_web
112
+ # @option options [String] :performance_bar_allowed_group_id
113
+ # @option options [String] :performance_bar_allowed_group_path
114
+ # @option options [Boolean] :performance_bar_enabled
115
+ # @option options [Boolean] :plantuml_enabled
116
+ # @option options [String] :plantuml_url
117
+ # @option options [Float] :polling_interval_multiplier
118
+ # @option options [Boolean] :project_export_enabled
119
+ # @option options [Boolean] :prometheus_metrics_enabled
120
+ # @option options [Boolean] :pseudonymizer_enabled
121
+ # @option options [Boolean] :recaptcha_enabled
122
+ # @option options [String] :recaptcha_private_key
123
+ # @option options [String] :recaptcha_site_key
124
+ # @option options [Boolean] :repository_checks_enabled
125
+ # @option options [Integer] :repository_size_limit
126
+ # @option options [Array<String>] :repository_storages
127
+ # @option options [Boolean] :require_two_factor_authentication
128
+ # @option options [Array<String>] :restricted_visibility_levels
129
+ # @option options [Integer] :rsa_key_restriction
130
+ # @option options [Boolean] :send_user_confirmation_email
131
+ # @option options [String] :sentry_dsn
132
+ # @option options [Boolean] :sentry_enabled
133
+ # @option options [Integer] :session_expire_delay
134
+ # @option options [Boolean] :shared_runners_enabled
135
+ # @option options [Integer] :shared_runners_minutes
136
+ # @option options [String] :shared_runners_text
137
+ # @option options [String] :sign_in_text
138
+ # @option options [String] :signin_enabled
139
+ # @option options [Boolean] :signup_enabled
140
+ # @option options [Boolean] :slack_app_enabled
141
+ # @option options [String] :slack_app_id
142
+ # @option options [String] :slack_app_secret
143
+ # @option options [String] :slack_app_verification_token
144
+ # @option options [Integer] :terminal_max_session_time
145
+ # @option options [String] :terms
146
+ # @option options [Boolean] :throttle_authenticated_api_enabled
147
+ # @option options [Integer] :throttle_authenticated_api_period_in_seconds
148
+ # @option options [Integer] :throttle_authenticated_api_requests_per_period
149
+ # @option options [Boolean] :throttle_authenticated_web_enabled
150
+ # @option options [Integer] :throttle_authenticated_web_period_in_seconds
151
+ # @option options [Integer] :throttle_authenticated_web_requests_per_period
152
+ # @option options [Boolean] :throttle_unauthenticated_enabled
153
+ # @option options [Integer] :throttle_unauthenticated_period_in_seconds
154
+ # @option options [Integer] :throttle_unauthenticated_requests_per_period
155
+ # @option options [Integer] :two_factor_grace_period
156
+ # @option options [Boolean] :unique_ips_limit_enabled
157
+ # @option options [Integer] :unique_ips_limit_per_user
158
+ # @option options [Integer] :unique_ips_limit_time_window
159
+ # @option options [Boolean] :usage_ping_enabled
160
+ # @option options [Boolean] :user_default_external
161
+ # @option options [Boolean] :user_oauth_applications
162
+ # @option options [Boolean] :user_show_add_ssh_key_message
163
+ # @option options [Boolean] :version_check_enabled
164
+ # @option options [Integer] :local_markdown_version
165
+ # @option options [String] :geo_node_allowed_ips
166
+ #
167
+ # @return [Array<Gitlab::ObjectifiedHash>]
168
+ def edit_application_settings(options = {})
169
+ put('/application/settings', body: options)
170
+ end
171
+ end
172
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Gitlab::Client
4
+ # Defines methods related to avatar.
5
+ # @see https://docs.gitlab.com/ce/api/avatar.html
6
+ module Avatar
7
+ # Get a single avatar URL for a user with the given email address.
8
+ #
9
+ # @example
10
+ # Gitlab.avatar(email: 'admin@example.com')
11
+ # Gitlab.avatar(email: 'admin@example.com', size: 32)
12
+ #
13
+ # @param [Hash] options A customizable set of options.
14
+ # @option options [String] :email(required) Public email address of the user.
15
+ # @option options [Integer] :size(optional) Single pixel dimension (since images are squares). Only used for avatar lookups at Gravatar or at the configured Libravatar server.
16
+ # @return <Gitlab::ObjectifiedHash>
17
+ def avatar(options = {})
18
+ get('/avatar', query: options)
19
+ end
20
+ end
21
+ end
@@ -19,6 +19,62 @@ class Gitlab::Client
19
19
  get("/projects/#{url_encode project}/boards", query: options)
20
20
  end
21
21
 
22
+ # Get a single board.
23
+ #
24
+ # @example
25
+ # Gitlab.board(5, 1)
26
+ #
27
+ # @param [Integer, String] project The ID or name of a project.
28
+ # @param [Integer] id The ID of a board.
29
+ # @return [Gitlab::ObjectifiedHash] Returns information about the board
30
+ def board(project, id)
31
+ get("/projects/#{url_encode project}/boards/#{id}")
32
+ end
33
+
34
+ # Creates a new board.
35
+ #
36
+ # @example
37
+ # Gitlab.create_board(5, 'newboard')
38
+ #
39
+ # @param [Integer, String] project The ID or name of a project.
40
+ # @param [String] name The name of the new board.
41
+ # @return [Gitlab::ObjectifiedHash] Information about created board.
42
+ def create_board(project, name)
43
+ body = { name: name }
44
+ post("/projects/#{url_encode project}/boards", body: body)
45
+ end
46
+
47
+ # Updates a board.
48
+ #
49
+ # @example
50
+ # Gitlab.edit_board(5, 1, name: 'new_name')
51
+ # Gitlab.edit_board(5, 1, name: 'new_name', assignee_id: 1, milestone_id: 1)
52
+ #
53
+ # @param [Integer, String] project The ID or name of a project.
54
+ # @param [Integer] id The ID of a board.
55
+ # @param [Hash] options A customizable set of options.
56
+ # @option options [String] :name(optional) The new name of the board.
57
+ # @option options [Integer] :assignee_id(optional) The assignee the board should be scoped to.
58
+ # @option options [Integer] :milestone_id(optional) The milestone the board should be scoped to.
59
+ # @option options [String] :labels(optional) Comma-separated list of label names which the board should be scoped to.
60
+ # @option options [Integer] :weight(optional) The weight range from 0 to 9, to which the board should be scoped to.
61
+ # @return [Gitlab::ObjectifiedHash] Information about updated board.
62
+ def edit_board(project, id, options = {})
63
+ put("/projects/#{url_encode project}/boards/#{id}", body: options)
64
+ end
65
+
66
+ # Deletes a board.
67
+ #
68
+ # @example
69
+ # Gitlab.delete_board(5, 1)
70
+ #
71
+ # @param [Integer, String] project The ID or name of a project.
72
+ # @param [Integer] id The ID of a board.
73
+ # @return [void] This API call returns an empty response body.
74
+ def delete_board(project, id)
75
+ delete("/projects/#{url_encode project}/boards/#{id}")
76
+ end
77
+
22
78
  # Gets a board lists
23
79
  #
24
80
  # @example
@@ -2,8 +2,8 @@
2
2
 
3
3
  class Gitlab::Client
4
4
  # Defines methods related to builds.
5
- # @see https://docs.gitlab.com/ce/api/build_variables.html
6
- # @see https://docs.gitlab.com/ee/api/group_level_variables.html
5
+ # @see https://docs.gitlab.com/ce/api/project_level_variables.html
6
+ # @see https://docs.gitlab.com/ce/api/group_level_variables.html
7
7
  module BuildVariables
8
8
  # Gets a list of the project's build variables
9
9
  #
@@ -36,9 +36,10 @@ class Gitlab::Client
36
36
  # @param [Integer, String] project The ID or name of a project.
37
37
  # @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
38
38
  # @param [String] value The value of a variable
39
+ # @param [Hash] opts optional parameters
39
40
  # @return [Gitlab::ObjectifiedHash] The variable.
40
- def create_variable(project, key, value)
41
- post("/projects/#{url_encode project}/variables", body: { key: key, value: value })
41
+ def create_variable(project, key, value, **opts)
42
+ post("/projects/#{url_encode project}/variables", body: opts.merge(key: key, value: value))
42
43
  end
43
44
 
44
45
  # Update a project's build variable.
@@ -49,9 +50,10 @@ class Gitlab::Client
49
50
  # @param [Integer, String] project The ID or name of a project.
50
51
  # @param [String] key The key of a variable
51
52
  # @param [String] value The value of a variable
53
+ # @param [Hash] opts optional parameters
52
54
  # @return [Gitlab::ObjectifiedHash] The variable.
53
- def update_variable(project, key, value)
54
- put("/projects/#{url_encode project}/variables/#{key}", body: { value: value })
55
+ def update_variable(project, key, value, **opts)
56
+ put("/projects/#{url_encode project}/variables/#{key}", body: opts.merge(value: value))
55
57
  end
56
58
 
57
59
  # Remove a project's build variable.
@@ -97,9 +99,10 @@ class Gitlab::Client
97
99
  # @param [Integer, String] group The ID or name of a group.
98
100
  # @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
99
101
  # @param [String] value The value of a variable
102
+ # @param [Hash] opts optional parameters
100
103
  # @return [Gitlab::ObjectifiedHash] The variable.
101
- def create_group_variable(group, key, value)
102
- post("/groups/#{url_encode group}/variables", body: { key: key, value: value })
104
+ def create_group_variable(group, key, value, **opts)
105
+ post("/groups/#{url_encode group}/variables", body: opts.merge(key: key, value: value))
103
106
  end
104
107
 
105
108
  # Update a group's build variable.
@@ -110,9 +113,10 @@ class Gitlab::Client
110
113
  # @param [Integer, String] group The ID or name of a group.
111
114
  # @param [String] key The key of a variable
112
115
  # @param [String] value The value of a variable
116
+ # @param [Hash] opts optional parameters
113
117
  # @return [Gitlab::ObjectifiedHash] The variable.
114
- def update_group_variable(group, key, value)
115
- put("/groups/#{url_encode group}/variables/#{key}", body: { value: value })
118
+ def update_group_variable(group, key, value, **opts)
119
+ put("/groups/#{url_encode group}/variables/#{key}", body: opts.merge(value: value))
116
120
  end
117
121
 
118
122
  # Remove a group's build variable.