fs-gitlab 4.18.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +270 -0
  3. data/LICENSE.txt +24 -0
  4. data/README.md +260 -0
  5. data/exe/gitlab +11 -0
  6. data/lib/gitlab/api.rb +24 -0
  7. data/lib/gitlab/cli.rb +89 -0
  8. data/lib/gitlab/cli_helpers.rb +243 -0
  9. data/lib/gitlab/client/access_requests.rb +103 -0
  10. data/lib/gitlab/client/application_settings.rb +172 -0
  11. data/lib/gitlab/client/avatar.rb +21 -0
  12. data/lib/gitlab/client/award_emojis.rb +137 -0
  13. data/lib/gitlab/client/boards.rb +146 -0
  14. data/lib/gitlab/client/branches.rb +135 -0
  15. data/lib/gitlab/client/broadcast_messages.rb +75 -0
  16. data/lib/gitlab/client/build_variables.rb +135 -0
  17. data/lib/gitlab/client/builds.rb +108 -0
  18. data/lib/gitlab/client/commits.rb +216 -0
  19. data/lib/gitlab/client/container_registry.rb +85 -0
  20. data/lib/gitlab/client/deployments.rb +34 -0
  21. data/lib/gitlab/client/environments.rb +89 -0
  22. data/lib/gitlab/client/epic_issues.rb +23 -0
  23. data/lib/gitlab/client/epics.rb +73 -0
  24. data/lib/gitlab/client/events.rb +60 -0
  25. data/lib/gitlab/client/features.rb +48 -0
  26. data/lib/gitlab/client/group_badges.rb +88 -0
  27. data/lib/gitlab/client/group_boards.rb +141 -0
  28. data/lib/gitlab/client/group_labels.rb +88 -0
  29. data/lib/gitlab/client/group_milestones.rb +94 -0
  30. data/lib/gitlab/client/groups.rb +358 -0
  31. data/lib/gitlab/client/issue_links.rb +48 -0
  32. data/lib/gitlab/client/issues.rb +231 -0
  33. data/lib/gitlab/client/jobs.rb +250 -0
  34. data/lib/gitlab/client/keys.rb +29 -0
  35. data/lib/gitlab/client/labels.rb +88 -0
  36. data/lib/gitlab/client/lint.rb +19 -0
  37. data/lib/gitlab/client/markdown.rb +23 -0
  38. data/lib/gitlab/client/merge_request_approvals.rb +265 -0
  39. data/lib/gitlab/client/merge_requests.rb +386 -0
  40. data/lib/gitlab/client/milestones.rb +106 -0
  41. data/lib/gitlab/client/namespaces.rb +22 -0
  42. data/lib/gitlab/client/notes.rb +313 -0
  43. data/lib/gitlab/client/packages.rb +95 -0
  44. data/lib/gitlab/client/pipeline_schedules.rb +147 -0
  45. data/lib/gitlab/client/pipeline_triggers.rb +103 -0
  46. data/lib/gitlab/client/pipelines.rb +105 -0
  47. data/lib/gitlab/client/project_badges.rb +85 -0
  48. data/lib/gitlab/client/project_clusters.rb +83 -0
  49. data/lib/gitlab/client/project_release_links.rb +76 -0
  50. data/lib/gitlab/client/project_releases.rb +79 -0
  51. data/lib/gitlab/client/projects.rb +708 -0
  52. data/lib/gitlab/client/protected_tags.rb +59 -0
  53. data/lib/gitlab/client/remote_mirrors.rb +51 -0
  54. data/lib/gitlab/client/repositories.rb +113 -0
  55. data/lib/gitlab/client/repository_files.rb +131 -0
  56. data/lib/gitlab/client/repository_submodules.rb +27 -0
  57. data/lib/gitlab/client/resource_label_events.rb +82 -0
  58. data/lib/gitlab/client/resource_state_events.rb +57 -0
  59. data/lib/gitlab/client/runners.rb +211 -0
  60. data/lib/gitlab/client/search.rb +66 -0
  61. data/lib/gitlab/client/services.rb +53 -0
  62. data/lib/gitlab/client/sidekiq.rb +39 -0
  63. data/lib/gitlab/client/snippets.rb +95 -0
  64. data/lib/gitlab/client/system_hooks.rb +64 -0
  65. data/lib/gitlab/client/tags.rb +97 -0
  66. data/lib/gitlab/client/templates.rb +100 -0
  67. data/lib/gitlab/client/todos.rb +46 -0
  68. data/lib/gitlab/client/user_snippets.rb +114 -0
  69. data/lib/gitlab/client/users.rb +397 -0
  70. data/lib/gitlab/client/versions.rb +18 -0
  71. data/lib/gitlab/client/wikis.rb +79 -0
  72. data/lib/gitlab/client.rb +95 -0
  73. data/lib/gitlab/configuration.rb +57 -0
  74. data/lib/gitlab/error.rb +170 -0
  75. data/lib/gitlab/file_response.rb +48 -0
  76. data/lib/gitlab/help.rb +94 -0
  77. data/lib/gitlab/objectified_hash.rb +51 -0
  78. data/lib/gitlab/page_links.rb +35 -0
  79. data/lib/gitlab/paginated_response.rb +110 -0
  80. data/lib/gitlab/request.rb +109 -0
  81. data/lib/gitlab/shell.rb +83 -0
  82. data/lib/gitlab/shell_history.rb +57 -0
  83. data/lib/gitlab/version.rb +5 -0
  84. data/lib/gitlab.rb +56 -0
  85. metadata +204 -0
data/lib/gitlab/cli.rb ADDED
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'gitlab'
4
+ require 'terminal-table/import'
5
+ require_relative 'cli_helpers'
6
+ require_relative 'shell'
7
+
8
+ class Gitlab::CLI
9
+ extend Helpers
10
+
11
+ # Starts a new CLI session.
12
+ #
13
+ # @example
14
+ # Gitlab::CLI.start(['help'])
15
+ # Gitlab::CLI.start(['help', 'issues'])
16
+ #
17
+ # @param [Array] args The command and it's optional arguments.
18
+ def self.start(args)
19
+ command = begin
20
+ args.shift.strip
21
+ rescue StandardError
22
+ 'help'
23
+ end
24
+ run(command, args)
25
+ end
26
+
27
+ # Processes a CLI command and outputs a result to the stream (stdout).
28
+ #
29
+ # @example
30
+ # Gitlab::CLI.run('help')
31
+ # Gitlab::CLI.run('help', ['issues'])
32
+ #
33
+ # @param [String] cmd The name of a command.
34
+ # @param [Array] args The optional arguments for a command.
35
+ # @return [nil]
36
+ def self.run(cmd, args = [])
37
+ case cmd
38
+ when 'help'
39
+ puts help(args.shift) { |out| out.gsub!(/Gitlab\./, 'gitlab ') }
40
+ when 'info'
41
+ endpoint = Gitlab.endpoint || 'not set'
42
+ private_token = Gitlab.private_token || 'not set'
43
+ puts "Gitlab endpoint is #{endpoint}"
44
+ puts "Gitlab private token is #{private_token}"
45
+ puts "Ruby Version is #{RUBY_VERSION}"
46
+ puts "Gitlab Ruby Gem #{Gitlab::VERSION}"
47
+ when '-v', '--version'
48
+ puts "Gitlab Ruby Gem #{Gitlab::VERSION}"
49
+ when 'shell'
50
+ Gitlab::Shell.start
51
+ else
52
+ if args.include? '--json'
53
+ @json_output = true
54
+ args.delete '--json'
55
+ end
56
+
57
+ unless valid_command?(cmd)
58
+ puts 'Unknown command. Run `gitlab help` for a list of available commands.'
59
+ exit(0) if ENV['CI'] # FIXME: workaround to exit with 0 on passed specs
60
+ exit(1)
61
+ end
62
+
63
+ command_args = args.any? && args.last.start_with?('--only=', '--except=') ? args[0..-2] : args
64
+
65
+ begin
66
+ command_args.map! { |arg| symbolize_keys(yaml_load(arg)) }
67
+ rescue StandardError => e
68
+ puts e.message
69
+ exit 1
70
+ end
71
+
72
+ confirm_command(cmd)
73
+
74
+ data = gitlab_helper(cmd, command_args) { exit(1) }
75
+
76
+ render_output(cmd, args, data)
77
+ end
78
+ end
79
+
80
+ # Helper method that checks whether we want to get the output as json
81
+ # @return [nil]
82
+ def self.render_output(cmd, args, data)
83
+ if defined?(@json_output) && @json_output
84
+ output_json(cmd, args, data)
85
+ else
86
+ output_table(cmd, args, data)
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,243 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+ require 'json'
5
+ require 'base64'
6
+
7
+ class Gitlab::CLI
8
+ # Defines methods related to CLI output and formatting.
9
+ module Helpers
10
+ module_function
11
+
12
+ # Returns actions available to CLI & Shell
13
+ #
14
+ # @return [Array]
15
+ def actions
16
+ @actions ||= Gitlab.actions
17
+ end
18
+
19
+ # Returns Gitlab::Client instance
20
+ #
21
+ # @return [Gitlab::Client]
22
+ def client
23
+ @client ||= Gitlab::Client.new(endpoint: (Gitlab.endpoint || ''))
24
+ end
25
+
26
+ # Returns method names and their owners
27
+ #
28
+ # @return [Array<Hash>]
29
+ def method_owners
30
+ @method_owners ||= actions.map do |action|
31
+ {
32
+ name: action.to_s,
33
+ owner: client.method(action).owner.to_s
34
+ }
35
+ end
36
+ end
37
+
38
+ # Returns filtered required fields.
39
+ #
40
+ # @return [Array]
41
+ def required_fields(args)
42
+ filtered_fields(args, '--only=')
43
+ end
44
+
45
+ # Returns filtered excluded fields.
46
+ #
47
+ # @return [Array]
48
+ def excluded_fields(args)
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(',')
59
+ end
60
+
61
+ # Confirms command is valid.
62
+ #
63
+ # @return [Boolean]
64
+ def valid_command?(cmd)
65
+ command = cmd.is_a?(Symbol) ? cmd : cmd.to_sym
66
+ Gitlab.actions.include?(command)
67
+ end
68
+
69
+ # Confirms command with a desctructive action.
70
+ #
71
+ # @return [String]
72
+ def confirm_command(cmd)
73
+ return unless cmd.start_with?('remove_', 'delete_')
74
+
75
+ puts 'Are you sure? (y/n)'
76
+
77
+ if %w[y yes].include?($stdin.gets.to_s.strip.downcase)
78
+ puts 'Proceeding..'
79
+ else
80
+ puts 'Command aborted.'
81
+ exit(1)
82
+ end
83
+ end
84
+
85
+ # Gets defined help for a specific command/action.
86
+ #
87
+ # @return [String]
88
+ def help(cmd = nil, &block)
89
+ if cmd.nil? || Gitlab::Help.help_map.key?(cmd)
90
+ Gitlab::Help.actions_table(cmd)
91
+ else
92
+ Gitlab::Help.get_help(cmd, &block)
93
+ end
94
+ end
95
+
96
+ # Outputs a nicely formatted table or error message.
97
+ def output_table(cmd, args, data)
98
+ case data
99
+ when Gitlab::ObjectifiedHash, Gitlab::FileResponse
100
+ puts record_table([data], cmd, args)
101
+ when Gitlab::PaginatedResponse
102
+ puts record_table(data, cmd, args)
103
+ else # probably just an error message
104
+ puts data
105
+ end
106
+ end
107
+
108
+ def output_json(cmd, args, data)
109
+ if data.respond_to?(:empty?) && data.empty?
110
+ puts '{}'
111
+ else
112
+ hash_result = case data
113
+ when Gitlab::ObjectifiedHash, Gitlab::FileResponse
114
+ record_hash([data], cmd, args, single_value: true)
115
+ when Gitlab::PaginatedResponse
116
+ record_hash(data, cmd, args)
117
+ else
118
+ { cmd: cmd, data: data, args: args }
119
+ end
120
+ puts JSON.pretty_generate(hash_result)
121
+ end
122
+ end
123
+
124
+ # Table to display records.
125
+ #
126
+ # @return [Terminal::Table]
127
+ def record_table(data, cmd, args)
128
+ return 'No data' if data.empty?
129
+
130
+ arr, keys = get_keys(args, data)
131
+
132
+ table do |t|
133
+ t.title = "Gitlab.#{cmd} #{args.join(', ')}"
134
+ t.headings = keys
135
+
136
+ arr.each_with_index do |hash, index|
137
+ values = []
138
+
139
+ keys.each do |key|
140
+ case value = hash[key]
141
+ when Hash
142
+ value = value.key?('id') ? value['id'] : 'Hash'
143
+ when StringIO
144
+ value = 'File'
145
+ when nil
146
+ value = 'null'
147
+ end
148
+
149
+ values << value
150
+ end
151
+
152
+ t.add_row values
153
+ t.add_separator unless arr.size - 1 == index
154
+ end
155
+ end
156
+ end
157
+
158
+ # Renders the result of given commands and arguments into a Hash
159
+ #
160
+ # @param [Array] data Resultset from the API call
161
+ # @param [String] cmd The command passed to the API
162
+ # @param [Array] args Options passed to the API call
163
+ # @param [bool] single_value If set to true, a single result should be returned
164
+ # @return [Hash] Result hash
165
+ def record_hash(data, cmd, args, single_value: false)
166
+ if data.empty?
167
+ result = nil
168
+ else
169
+ arr, keys = get_keys(args, data)
170
+ result = []
171
+ arr.each do |hash|
172
+ row = {}
173
+
174
+ keys.each do |key|
175
+ row[key] = case hash[key]
176
+ when Hash
177
+ 'Hash'
178
+ when StringIO
179
+ Base64.encode64(hash[key].read)
180
+ when nil
181
+ nil
182
+ else
183
+ hash[key]
184
+ end
185
+ end
186
+
187
+ result.push row
188
+ end
189
+ result = result[0] if single_value && result.count.positive?
190
+ end
191
+
192
+ {
193
+ cmd: "Gitlab.#{cmd} #{args.join(', ')}".strip,
194
+ result: result
195
+ }
196
+ end
197
+
198
+ # Helper function to get rows and keys from data returned from API call
199
+ def get_keys(args, data)
200
+ arr = data.map(&:to_h)
201
+ keys = arr.first.keys.sort_by(&:to_s)
202
+ keys &= required_fields(args) if required_fields(args).any?
203
+ keys -= excluded_fields(args)
204
+ [arr, keys]
205
+ end
206
+
207
+ # Helper function to call Gitlab commands with args.
208
+ def gitlab_helper(cmd, args = [])
209
+ args.any? ? Gitlab.send(cmd, *args) : Gitlab.send(cmd)
210
+ rescue StandardError => e
211
+ puts e.message
212
+ yield if block_given?
213
+ end
214
+
215
+ # Convert a hash (recursively) to use symbol hash keys
216
+ # @return [Hash]
217
+ def symbolize_keys(hash)
218
+ if hash.is_a?(Hash)
219
+ hash = hash.each_with_object({}) do |(key, value), new_hash|
220
+ new_hash[key.to_sym] = symbolize_keys(value)
221
+ rescue NoMethodError
222
+ raise "Error: cannot convert hash key to symbol: #{key}"
223
+ end
224
+ end
225
+
226
+ hash
227
+ end
228
+
229
+ # Check if arg is a color in 6-digit hex notation with leading '#' sign
230
+ def hex_color?(arg)
231
+ pattern = /\A#\h{6}\Z/
232
+
233
+ pattern.match(arg)
234
+ end
235
+
236
+ # YAML::load on a single argument
237
+ def yaml_load(arg)
238
+ hex_color?(arg) ? arg : YAML.safe_load(arg)
239
+ rescue Psych::SyntaxError
240
+ raise "Error: Argument is not valid YAML syntax: #{arg}"
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Gitlab::Client
4
+ # Defines methods related to Award Emojis.
5
+ # @see https://docs.gitlab.com/ce/api/access_requests.html
6
+ module AccessRequests
7
+ # Gets a list of access requests for a project viewable by the authenticated user.
8
+ #
9
+ # @example
10
+ # Gitlab.project_access_requests(1)
11
+ #
12
+ # @param [Integer, String] :project(required) The ID or name of a project.
13
+ # @return [Array<Gitlab::ObjectifiedHash>] List of project access requests
14
+ def project_access_requests(project)
15
+ get("/projects/#{url_encode project}/access_requests")
16
+ end
17
+
18
+ # Gets a list of access requests for a group viewable by the authenticated user.
19
+ #
20
+ # @example
21
+ # Gitlab.group_access_requests(1)
22
+ #
23
+ # @param [Integer, String] :group(required) The ID or name of a group.
24
+ # @return [Array<Gitlab::ObjectifiedHash>] List of group access requests
25
+ def group_access_requests(group)
26
+ get("/groups/#{url_encode group}/access_requests")
27
+ end
28
+
29
+ # Requests access for the authenticated user to a project.
30
+ #
31
+ # @example
32
+ # Gitlab.request_project_access(1)
33
+ #
34
+ # @param [Integer, String] :project(required) The ID or name of a project.
35
+ # @return <Gitlab::ObjectifiedHash] Information about the requested project access
36
+ def request_project_access(project)
37
+ post("/projects/#{url_encode project}/access_requests")
38
+ end
39
+
40
+ # Requests access for the authenticated user to a group.
41
+ #
42
+ # @example
43
+ # Gitlab.request_group_access(1)
44
+ #
45
+ # @param [Integer, String] :group(required) The ID or name of a group.
46
+ # @return <Gitlab::ObjectifiedHash] Information about the requested group access
47
+ def request_group_access(group)
48
+ post("/groups/#{url_encode group}/access_requests")
49
+ end
50
+
51
+ # Approves a project access request for the given user.
52
+ #
53
+ # @example
54
+ # Gitlab.approve_project_access_request(1, 1)
55
+ # Gitlab.approve_project_access_request(1, 1, {access_level: '30'})
56
+ #
57
+ # @param [Integer, String] :project(required) The ID or name of a project.
58
+ # @param [Integer] :user_id(required) The user ID of the access requester
59
+ # @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
60
+ # @return <Gitlab::ObjectifiedHash] Information about the approved project access request
61
+ def approve_project_access_request(project, user_id, options = {})
62
+ put("/projects/#{url_encode project}/access_requests/#{user_id}/approve", body: options)
63
+ end
64
+
65
+ # Approves a group access request for the given user.
66
+ #
67
+ # @example
68
+ # Gitlab.approve_group_access_request(1, 1)
69
+ # Gitlab.approve_group_access_request(1, 1, {access_level: '30'})
70
+ #
71
+ # @param [Integer, String] :group(required) The ID or name of a group.
72
+ # @param [Integer] :user_id(required) The user ID of the access requester
73
+ # @option options [Integer] :access_level(optional) A valid access level (defaults: 30, developer access level)
74
+ # @return <Gitlab::ObjectifiedHash] Information about the approved group access request
75
+ def approve_group_access_request(group, user_id, options = {})
76
+ put("/groups/#{url_encode group}/access_requests/#{user_id}/approve", body: options)
77
+ end
78
+
79
+ # Denies a project access request for the given user.
80
+ #
81
+ # @example
82
+ # Gitlab.deny_project_access_request(1, 1)
83
+ #
84
+ # @param [Integer, String] :project(required) The ID or name of a project.
85
+ # @param [Integer] :user_id(required) The user ID of the access requester
86
+ # @return [void] This API call returns an empty response body.
87
+ def deny_project_access_request(project, user_id)
88
+ delete("/projects/#{url_encode project}/access_requests/#{user_id}")
89
+ end
90
+
91
+ # Denies a group access request for the given user.
92
+ #
93
+ # @example
94
+ # Gitlab.deny_group_access_request(1, 1)
95
+ #
96
+ # @param [Integer, String] :group(required) The ID or name of a group.
97
+ # @param [Integer] :user_id(required) The user ID of the access requester
98
+ # @return [void] This API call returns an empty response body.
99
+ def deny_group_access_request(group, user_id)
100
+ delete("/groups/#{url_encode group}/access_requests/#{user_id}")
101
+ end
102
+ end
103
+ end
@@ -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