settings.go

  1//
  2// Copyright 2017, Sander van Harmelen
  3//
  4// Licensed under the Apache License, Version 2.0 (the "License");
  5// you may not use this file except in compliance with the License.
  6// You may obtain a copy of the License at
  7//
  8//     http://www.apache.org/licenses/LICENSE-2.0
  9//
 10// Unless required by applicable law or agreed to in writing, software
 11// distributed under the License is distributed on an "AS IS" BASIS,
 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13// See the License for the specific language governing permissions and
 14// limitations under the License.
 15//
 16
 17package gitlab
 18
 19import "time"
 20
 21// SettingsService handles communication with the application SettingsService
 22// related methods of the GitLab API.
 23//
 24// GitLab API docs: https://docs.gitlab.com/ce/api/settings.html
 25type SettingsService struct {
 26	client *Client
 27}
 28
 29// Settings represents the GitLab application settings.
 30//
 31// GitLab API docs: https://docs.gitlab.com/ce/api/settings.html
 32type Settings struct {
 33	ID                                        int               `json:"id"`
 34	CreatedAt                                 *time.Time        `json:"created_at"`
 35	UpdatedAt                                 *time.Time        `json:"updated_at"`
 36	AdminNotificationEmail                    string            `json:"admin_notification_email"`
 37	AfterSignOutPath                          string            `json:"after_sign_out_path"`
 38	AfterSignUpText                           string            `json:"after_sign_up_text"`
 39	AkismetAPIKey                             string            `json:"akismet_api_key"`
 40	AkismetEnabled                            bool              `json:"akismet_enabled"`
 41	AllowGroupOwnersToManageLDAP              bool              `json:"allow_group_owners_to_manage_ldap"`
 42	AllowLocalRequestsFromHooksAndServices    bool              `json:"allow_local_requests_from_hooks_and_services"`
 43	AllowLocalRequestsFromSystemHooks         bool              `json:"allow_local_requests_from_system_hooks"`
 44	AllowLocalRequestsFromWebHooksAndServices bool              `json:"allow_local_requests_from_web_hooks_and_services"`
 45	ArchiveBuildsInHumanReadable              string            `json:"archive_builds_in_human_readable"`
 46	AssetProxyEnabled                         bool              `json:"asset_proxy_enabled"`
 47	AssetProxySecretKey                       string            `json:"asset_proxy_secret_key"`
 48	AssetProxyURL                             string            `json:"asset_proxy_url"`
 49	AssetProxyWhitelist                       []string          `json:"asset_proxy_whitelist"`
 50	AuthorizedKeysEnabled                     bool              `json:"authorized_keys_enabled_enabled"`
 51	AutoDevOpsDomain                          string            `json:"auto_devops_domain"`
 52	AutoDevOpsEnabled                         bool              `json:"auto_devops_enabled"`
 53	CheckNamespacePlan                        bool              `json:"check_namespace_plan"`
 54	CommitEmailHostname                       string            `json:"commit_email_hostname"`
 55	ContainerRegistryTokenExpireDelay         int               `json:"container_registry_token_expire_delay"`
 56	DefaultArtifactsExpireIn                  string            `json:"default_artifacts_expire_in"`
 57	DefaultBranchProtection                   int               `json:"default_branch_protection"`
 58	DefaultGroupVisibility                    *VisibilityValue  `json:"default_group_visibility"`
 59	DefaultProjectCreation                    int               `json:"default_project_creation"`
 60	DefaultProjectsLimit                      int               `json:"default_projects_limit"`
 61	DefaultProjectVisibility                  *VisibilityValue  `json:"default_project_visibility"`
 62	DefaultSnippetVisibility                  *VisibilityValue  `json:"default_snippet_visibility"`
 63	DiffMaxPatchBytes                         int               `json:"diff_max_patch_bytes"`
 64	DisabledOauthSignInSources                []string          `json:"disabled_oauth_sign_in_sources"`
 65	DNSRebindingProtectionEnabled             bool              `json:"dns_rebinding_protection_enabled"`
 66	DomainBlacklist                           []string          `json:"domain_blacklist"`
 67	DomainBlacklistEnabled                    bool              `json:"domain_blacklist_enabled"`
 68	DomainWhitelist                           []string          `json:"domain_whitelist"`
 69	DSAKeyRestriction                         int               `json:"dsa_key_restriction"`
 70	ECDSAKeyRestriction                       int               `json:"ecdsa_key_restriction"`
 71	Ed25519KeyRestriction                     int               `json:"ed25519_key_restriction"`
 72	ElasticsearchAWSAccessKey                 string            `json:"elasticsearch_aws_access_key"`
 73	ElasticsearchAWS                          bool              `json:"elasticsearch_aws"`
 74	ElasticsearchAWSRegion                    string            `json:"elasticsearch_aws_region"`
 75	ElasticsearchAWSSecretAccessKey           string            `json:"elasticsearch_aws_secret_access_key"`
 76	ElasticsearchIndexing                     bool              `json:"elasticsearch_indexing"`
 77	ElasticsearchLimitIndexing                bool              `json:"elasticsearch_limit_indexing"`
 78	ElasticsearchNamespaceIDs                 []int             `json:"elasticsearch_namespace_ids"`
 79	ElasticsearchProjectIDs                   []int             `json:"elasticsearch_project_ids"`
 80	ElasticsearchSearch                       bool              `json:"elasticsearch_search"`
 81	ElasticsearchURL                          []string          `json:"elasticsearch_url"`
 82	EmailAdditionalText                       string            `json:"email_additional_text"`
 83	EmailAuthorInBody                         bool              `json:"email_author_in_body"`
 84	EnabledGitAccessProtocol                  string            `json:"enabled_git_access_protocol"`
 85	EnforceTerms                              bool              `json:"enforce_terms"`
 86	ExternalAuthClientCert                    string            `json:"external_auth_client_cert"`
 87	ExternalAuthClientKeyPass                 string            `json:"external_auth_client_key_pass"`
 88	ExternalAuthClientKey                     string            `json:"external_auth_client_key"`
 89	ExternalAuthorizationServiceDefaultLabel  string            `json:"external_authorization_service_default_label"`
 90	ExternalAuthorizationServiceEnabled       bool              `json:"external_authorization_service_enabled"`
 91	ExternalAuthorizationServiceTimeout       float64           `json:"external_authorization_service_timeout"`
 92	ExternalAuthorizationServiceURL           string            `json:"external_authorization_service_url"`
 93	FileTemplateProjectID                     int               `json:"file_template_project_id"`
 94	FirstDayOfWeek                            int               `json:"first_day_of_week"`
 95	GeoNodeAllowedIPs                         string            `json:"geo_node_allowed_ips"`
 96	GeoStatusTimeout                          int               `json:"geo_status_timeout"`
 97	GitalyTimeoutDefault                      int               `json:"gitaly_timeout_default"`
 98	GitalyTimeoutFast                         int               `json:"gitaly_timeout_fast"`
 99	GitalyTimeoutMedium                       int               `json:"gitaly_timeout_medium"`
100	GrafanaEnabled                            bool              `json:"grafana_enabled"`
101	GrafanaURL                                string            `json:"grafana_url"`
102	GravatarEnabled                           bool              `json:"gravatar_enabled"`
103	HashedStorageEnabled                      bool              `json:"hashed_storage_enabled"`
104	HelpPageHideCommercialContent             bool              `json:"help_page_hide_commercial_content"`
105	HelpPageSupportURL                        string            `json:"help_page_support_url"`
106	HelpPageText                              string            `json:"help_page_text"`
107	HelpText                                  string            `json:"help_text"`
108	HideThirdPartyOffers                      bool              `json:"hide_third_party_offers"`
109	HomePageURL                               string            `json:"home_page_url"`
110	HousekeepingBitmapsEnabled                bool              `json:"housekeeping_bitmaps_enabled"`
111	HousekeepingEnabled                       bool              `json:"housekeeping_enabled"`
112	HousekeepingFullRepackPeriod              int               `json:"housekeeping_full_repack_period"`
113	HousekeepingGcPeriod                      int               `json:"housekeeping_gc_period"`
114	HousekeepingIncrementalRepackPeriod       int               `json:"housekeeping_incremental_repack_period"`
115	HTMLEmailsEnabled                         bool              `json:"html_emails_enabled"`
116	ImportSources                             []string          `json:"import_sources"`
117	InstanceStatisticsVisibilityPrivate       bool              `json:"instance_statistics_visibility_private"`
118	LocalMarkdownVersion                      int               `json:"local_markdown_version"`
119	MaxArtifactsSize                          int               `json:"max_artifacts_size"`
120	MaxAttachmentSize                         int               `json:"max_attachment_size"`
121	MaxPagesSize                              int               `json:"max_pages_size"`
122	MetricsEnabled                            bool              `json:"metrics_enabled"`
123	MetricsHost                               string            `json:"metrics_host"`
124	MetricsMethodCallThreshold                int               `json:"metrics_method_call_threshold"`
125	MetricsPacketSize                         int               `json:"metrics_packet_size"`
126	MetricsPoolSize                           int               `json:"metrics_pool_size"`
127	MetricsPort                               int               `json:"metrics_port"`
128	MetricsSampleInterval                     int               `json:"metrics_sample_interval"`
129	MetricsTimeout                            int               `json:"metrics_timeout"`
130	MirrorAvailable                           bool              `json:"mirror_available"`
131	MirrorCapacityThreshold                   int               `json:"mirror_capacity_threshold"`
132	MirrorMaxCapacity                         int               `json:"mirror_max_capacity"`
133	MirrorMaxDelay                            int               `json:"mirror_max_delay"`
134	OutboundLocalRequestsWhitelist            []string          `json:"outbound_local_requests_whitelist"`
135	PagesDomainVerificationEnabled            bool              `json:"pages_domain_verification_enabled"`
136	PasswordAuthenticationEnabledForGit       bool              `json:"password_authentication_enabled_for_git"`
137	PasswordAuthenticationEnabledForWeb       bool              `json:"password_authentication_enabled_for_web"`
138	PerformanceBarAllowedGroupID              string            `json:"performance_bar_allowed_group_id"`
139	PerformanceBarAllowedGroupPath            string            `json:"performance_bar_allowed_group_path"`
140	PerformanceBarEnabled                     bool              `json:"performance_bar_enabled"`
141	PlantumlEnabled                           bool              `json:"plantuml_enabled"`
142	PlantumlURL                               string            `json:"plantuml_url"`
143	PollingIntervalMultiplier                 float64           `json:"polling_interval_multiplier,string"`
144	ProjectExportEnabled                      bool              `json:"project_export_enabled"`
145	PrometheusMetricsEnabled                  bool              `json:"prometheus_metrics_enabled"`
146	ProtectedCIVariables                      bool              `json:"protected_ci_variables"`
147	PseudonymizerEnabled                      bool              `json:"psedonymizer_enabled"`
148	PushEventHooksLimit                       int               `json:"push_event_hooks_limit"`
149	PushEventActivitiesLimit                  int               `json:"push_event_activities_limit"`
150	RecaptchaEnabled                          bool              `json:"recaptcha_enabled"`
151	RecaptchaPrivateKey                       string            `json:"recaptcha_private_key"`
152	RecaptchaSiteKey                          string            `json:"recaptcha_site_key"`
153	ReceiveMaxInputSize                       int               `json:"receive_max_input_size"`
154	RepositoryChecksEnabled                   bool              `json:"repository_checks_enabled"`
155	RepositorySizeLimit                       int               `json:"repository_size_limit"`
156	RepositoryStorages                        []string          `json:"repository_storages"`
157	RequireTwoFactorAuthentication            bool              `json:"require_two_factor_authentication"`
158	RestrictedVisibilityLevels                []VisibilityValue `json:"restricted_visibility_levels"`
159	RsaKeyRestriction                         int               `json:"rsa_key_restriction"`
160	SendUserConfirmationEmail                 bool              `json:"send_user_confirmation_email"`
161	SessionExpireDelay                        int               `json:"session_expire_delay"`
162	SharedRunnersEnabled                      bool              `json:"shared_runners_enabled"`
163	SharedRunnersMinutes                      int               `json:"shared_runners_minutes"`
164	SharedRunnersText                         string            `json:"shared_runners_text"`
165	SignInText                                string            `json:"sign_in_text"`
166	SignupEnabled                             bool              `json:"signup_enabled"`
167	SlackAppEnabled                           bool              `json:"slack_app_enabled"`
168	SlackAppID                                string            `json:"slack_app_id"`
169	SlackAppSecret                            string            `json:"slack_app_secret"`
170	SlackAppVerificationToken                 string            `json:"slack_app_verification_token"`
171	SnowplowCollectorHostname                 string            `json:"snowplow_collector_hostname"`
172	SnowplowCookieDomain                      string            `json:"snowplow_cookie_domain"`
173	SnowplowEnabled                           bool              `json:"snowplow_enabled"`
174	SnowplowSiteID                            string            `json:"snowplow_site_id"`
175	TerminalMaxSessionTime                    int               `json:"terminal_max_session_time"`
176	Terms                                     string            `json:"terms"`
177	ThrottleAuthenticatedAPIEnabled           bool              `json:"throttle_authenticated_api_enabled"`
178	ThrottleAuthenticatedAPIPeriodInSeconds   int               `json:"throttle_authenticated_api_period_in_seconds"`
179	ThrottleAuthenticatedAPIRequestsPerPeriod int               `json:"throttle_authenticated_api_requests_per_period"`
180	ThrottleAuthenticatedWebEnabled           bool              `json:"throttle_authenticated_web_enabled"`
181	ThrottleAuthenticatedWebPeriodInSeconds   int               `json:"throttle_authenticated_web_period_in_seconds"`
182	ThrottleAuthenticatedWebRequestsPerPeriod int               `json:"throttle_authenticated_web_requests_per_period"`
183	ThrottleUnauthenticatedEnabled            bool              `json:"throttle_unauthenticated_enabled"`
184	ThrottleUnauthenticatedPeriodInSeconds    int               `json:"throttle_unauthenticated_period_in_seconds"`
185	ThrottleUnauthenticatedRequestsPerPeriod  int               `json:"throttle_unauthenticated_requests_per_period"`
186	TimeTrackingLimitToHours                  bool              `json:"time_tracking_limit_to_hours"`
187	TwoFactorGracePeriod                      int               `json:"two_factor_grace_period"`
188	UniqueIPsLimitEnabled                     bool              `json:"unique_ips_limit_enabled"`
189	UniqueIPsLimitPerUser                     int               `json:"unique_ips_limit_per_user"`
190	UniqueIPsLimitTimeWindow                  int               `json:"unique_ips_limit_time_window"`
191	UsagePingEnabled                          bool              `json:"usage_ping_enabled"`
192	UserDefaultExternal                       bool              `json:"user_default_external"`
193	UserDefaultInternalRegex                  string            `json:"user_default_internal_regex"`
194	UserOauthApplications                     bool              `json:"user_oauth_applications"`
195	UserShowAddSSHKeyMessage                  bool              `json:"user_show_add_ssh_key_message"`
196	VersionCheckEnabled                       bool              `json:"version_check_enabled"`
197	WebIDEClientsidePreviewEnabled            bool              `json:"web_ide_clientside_preview_enabled"`
198}
199
200func (s Settings) String() string {
201	return Stringify(s)
202}
203
204// GetSettings gets the current application settings.
205//
206// GitLab API docs:
207// https://docs.gitlab.com/ce/api/settings.html#get-current-application.settings
208func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Response, error) {
209	req, err := s.client.NewRequest("GET", "application/settings", nil, options)
210	if err != nil {
211		return nil, nil, err
212	}
213
214	as := new(Settings)
215	resp, err := s.client.Do(req, as)
216	if err != nil {
217		return nil, resp, err
218	}
219
220	return as, resp, err
221}
222
223// UpdateSettingsOptions represents the available UpdateSettings() options.
224//
225// GitLab API docs:
226// https://docs.gitlab.com/ce/api/settings.html#change-application.settings
227type UpdateSettingsOptions struct {
228	AdminNotificationEmail                    *string           `url:"admin_notification_email,omitempty" json:"admin_notification_email,omitempty"`
229	AfterSignOutPath                          *string           `url:"after_sign_out_path,omitempty" json:"after_sign_out_path,omitempty"`
230	AfterSignUpText                           *string           `url:"after_sign_up_text,omitempty" json:"after_sign_up_text,omitempty"`
231	AkismetAPIKey                             *string           `url:"akismet_api_key,omitempty" json:"akismet_api_key,omitempty"`
232	AkismetEnabled                            *bool             `url:"akismet_enabled,omitempty" json:"akismet_enabled,omitempty"`
233	AllowGroupOwnersToManageLDAP              *bool             `url:"allow_group_owners_to_manage_ldap,omitempty" json:"allow_group_owners_to_manage_ldap,omitempty"`
234	AllowLocalRequestsFromHooksAndServices    *bool             `url:"allow_local_requests_from_hooks_and_services,omitempty" json:"allow_local_requests_from_hooks_and_services,omitempty"`
235	AllowLocalRequestsFromSystemHooks         *bool             `url:"allow_local_requests_from_system_hooks,omitempty" json:"allow_local_requests_from_system_hooks,omitempty"`
236	AllowLocalRequestsFromWebHooksAndServices *bool             `url:"allow_local_requests_from_web_hooks_and_services,omitempty" json:"allow_local_requests_from_web_hooks_and_services,omitempty"`
237	ArchiveBuildsInHumanReadable              *string           `url:"archive_builds_in_human_readable,omitempty" json:"archive_builds_in_human_readable,omitempty"`
238	AssetProxyEnabled                         *bool             `url:"asset_proxy_enabled,omitempty" json:"asset_proxy_enabled,omitempty"`
239	AssetProxySecretKey                       *string           `url:"asset_proxy_secret_key,omitempty" json:"asset_proxy_secret_key,omitempty"`
240	AssetProxyURL                             *string           `url:"asset_proxy_url,omitempty" json:"asset_proxy_url,omitempty"`
241	AssetProxyWhitelist                       []string          `url:"asset_proxy_whitelist,omitempty" json:"asset_proxy_whitelist,omitempty"`
242	AuthorizedKeysEnabled                     *bool             `url:"authorized_keys_enabled,omitempty" json:"authorized_keys_enabled,omitempty"`
243	AutoDevOpsDomain                          *string           `url:"auto_devops_domain,omitempty" json:"auto_devops_domain,omitempty"`
244	AutoDevOpsEnabled                         *bool             `url:"auto_devops_enabled,omitempty" json:"auto_devops_enabled,omitempty"`
245	CheckNamespacePlan                        *bool             `url:"check_namespace_plan,omitempty" json:"check_namespace_plan,omitempty"`
246	CommitEmailHostname                       *string           `url:"commit_email_hostname,omitempty" json:"commit_email_hostname,omitempty"`
247	ContainerRegistryTokenExpireDelay         *int              `url:"container_registry_token_expire_delay,omitempty" json:"container_registry_token_expire_delay,omitempty"`
248	DefaultArtifactsExpireIn                  *string           `url:"default_artifacts_expire_in,omitempty" json:"default_artifacts_expire_in,omitempty"`
249	DefaultBranchProtection                   *int              `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"`
250	DefaultGroupVisibility                    *VisibilityValue  `url:"default_group_visibility,omitempty" json:"default_group_visibility,omitempty"`
251	DefaultProjectCreation                    *int              `url:"default_project_creation,omitempty" json:"default_project_creation,omitempty"`
252	DefaultProjectsLimit                      *int              `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"`
253	DefaultProjectVisibility                  *VisibilityValue  `url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"`
254	DefaultSnippetVisibility                  *VisibilityValue  `url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"`
255	DiffMaxPatchBytes                         *int              `url:"diff_max_patch_bytes,omitempty" json:"diff_max_patch_bytes,omitempty"`
256	DisabledOauthSignInSources                []string          `url:"disabled_oauth_sign_in_sources,omitempty" json:"disabled_oauth_sign_in_sources,omitempty"`
257	DNSRebindingProtectionEnabled             *bool             `url:"dns_rebinding_protection_enabled,omitempty" json:"dns_rebinding_protection_enabled,omitempty"`
258	DomainBlacklist                           []string          `url:"domain_blacklist,omitempty" json:"domain_blacklist,omitempty"`
259	DomainBlacklistEnabled                    *bool             `url:"domain_blacklist_enabled,omitempty" json:"domain_blacklist_enabled,omitempty"`
260	DomainWhitelist                           []string          `url:"domain_whitelist,omitempty" json:"domain_whitelist,omitempty"`
261	DSAKeyRestriction                         *int              `url:"dsa_key_restriction,omitempty" json:"dsa_key_restriction,omitempty"`
262	ECDSAKeyRestriction                       *int              `url:"ecdsa_key_restriction,omitempty" json:"ecdsa_key_restriction,omitempty"`
263	Ed25519KeyRestriction                     *int              `url:"ed25519_key_restriction,omitempty" json:"ed25519_key_restriction,omitempty"`
264	ElasticsearchAWSAccessKey                 *string           `url:"elasticsearch_aws_access_key,omitempty" json:"elasticsearch_aws_access_key,omitempty"`
265	ElasticsearchAWS                          *bool             `url:"elasticsearch_aws,omitempty" json:"elasticsearch_aws,omitempty"`
266	ElasticsearchAWSRegion                    *string           `url:"elasticsearch_aws_region,omitempty" json:"elasticsearch_aws_region,omitempty"`
267	ElasticsearchAWSSecretAccessKey           *string           `url:"elasticsearch_aws_secret_access_key,omitempty" json:"elasticsearch_aws_secret_access_key,omitempty"`
268	ElasticsearchIndexing                     *bool             `url:"elasticsearch_indexing,omitempty" json:"elasticsearch_indexing,omitempty"`
269	ElasticsearchLimitIndexing                *bool             `url:"elasticsearch_limit_indexing,omitempty" json:"elasticsearch_limit_indexing,omitempty"`
270	ElasticsearchNamespaceIDs                 []int             `url:"elasticsearch_namespace_ids,omitempty" json:"elasticsearch_namespace_ids,omitempty"`
271	ElasticsearchProjectIDs                   []int             `url:"elasticsearch_project_ids,omitempty" json:"elasticsearch_project_ids,omitempty"`
272	ElasticsearchSearch                       *bool             `url:"elasticsearch_search,omitempty" json:"elasticsearch_search,omitempty"`
273	ElasticsearchURL                          *string           `url:"elasticsearch_url,omitempty" json:"elasticsearch_url,omitempty"`
274	EmailAdditionalText                       *string           `url:"email_additional_text,omitempty" json:"email_additional_text,omitempty"`
275	EmailAuthorInBody                         *bool             `url:"email_author_in_body,omitempty" json:"email_author_in_body,omitempty"`
276	EnabledGitAccessProtocol                  *string           `url:"enabled_git_access_protocol,omitempty" json:"enabled_git_access_protocol,omitempty"`
277	EnforceTerms                              *bool             `url:"enforce_terms,omitempty" json:"enforce_terms,omitempty"`
278	ExternalAuthClientCert                    *string           `url:"external_auth_client_cert,omitempty" json:"external_auth_client_cert,omitempty"`
279	ExternalAuthClientKeyPass                 *string           `url:"external_auth_client_key_pass,omitempty" json:"external_auth_client_key_pass,omitempty"`
280	ExternalAuthClientKey                     *string           `url:"external_auth_client_key,omitempty" json:"external_auth_client_key,omitempty"`
281	ExternalAuthorizationServiceDefaultLabel  *string           `url:"external_authorization_service_default_label,omitempty" json:"external_authorization_service_default_label,omitempty"`
282	ExternalAuthorizationServiceEnabled       *bool             `url:"external_authorization_service_enabled,omitempty" json:"external_authorization_service_enabled,omitempty"`
283	ExternalAuthorizationServiceTimeout       *float64          `url:"external_authorization_service_timeout,omitempty" json:"external_authorization_service_timeout,omitempty"`
284	ExternalAuthorizationServiceURL           *string           `url:"external_authorization_service_url,omitempty" json:"external_authorization_service_url,omitempty"`
285	FileTemplateProjectID                     *int              `url:"file_template_project_id,omitempty" json:"file_template_project_id,omitempty"`
286	FirstDayOfWeek                            *int              `url:"first_day_of_week,omitempty" json:"first_day_of_week,omitempty"`
287	GeoNodeAllowedIPs                         *string           `url:"geo_node_allowed_ips,omitempty" json:"geo_node_allowed_ips,omitempty"`
288	GeoStatusTimeout                          *int              `url:"geo_status_timeout,omitempty" json:"geo_status_timeout,omitempty"`
289	GitalyTimeoutDefault                      *int              `url:"gitaly_timeout_default,omitempty" json:"gitaly_timeout_default,omitempty"`
290	GitalyTimeoutFast                         *int              `url:"gitaly_timeout_fast,omitempty" json:"gitaly_timeout_fast,omitempty"`
291	GitalyTimeoutMedium                       *int              `url:"gitaly_timeout_medium,omitempty" json:"gitaly_timeout_medium,omitempty"`
292	GrafanaEnabled                            *bool             `url:"grafana_enabled,omitempty" json:"grafana_enabled,omitempty"`
293	GrafanaURL                                *string           `url:"grafana_url,omitempty" json:"grafana_url,omitempty"`
294	GravatarEnabled                           *bool             `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"`
295	HashedStorageEnabled                      *bool             `url:"hashed_storage_enabled,omitempty" json:"hashed_storage_enabled,omitempty"`
296	HelpPageHideCommercialContent             *bool             `url:"help_page_hide_commercial_content,omitempty" json:"help_page_hide_commercial_content,omitempty"`
297	HelpPageSupportURL                        *string           `url:"help_page_support_url,omitempty" json:"help_page_support_url,omitempty"`
298	HelpPageText                              *string           `url:"help_page_text,omitempty" json:"help_page_text,omitempty"`
299	HelpText                                  *string           `url:"help_text,omitempty" json:"help_text,omitempty"`
300	HideThirdPartyOffers                      *bool             `url:"hide_third_party_offers,omitempty" json:"hide_third_party_offers,omitempty"`
301	HomePageURL                               *string           `url:"home_page_url,omitempty" json:"home_page_url,omitempty"`
302	HousekeepingBitmapsEnabled                *bool             `url:"housekeeping_bitmaps_enabled,omitempty" json:"housekeeping_bitmaps_enabled,omitempty"`
303	HousekeepingEnabled                       *bool             `url:"housekeeping_enabled,omitempty" json:"housekeeping_enabled,omitempty"`
304	HousekeepingFullRepackPeriod              *int              `url:"housekeeping_full_repack_period,omitempty" json:"housekeeping_full_repack_period,omitempty"`
305	HousekeepingGcPeriod                      *int              `url:"housekeeping_gc_period,omitempty" json:"housekeeping_gc_period,omitempty"`
306	HousekeepingIncrementalRepackPeriod       *int              `url:"housekeeping_incremental_repack_period,omitempty" json:"housekeeping_incremental_repack_period,omitempty"`
307	HTMLEmailsEnabled                         *bool             `url:"html_emails_enabled,omitempty" json:"html_emails_enabled,omitempty"`
308	ImportSources                             []string          `url:"import_sources,omitempty" json:"import_sources,omitempty"`
309	InstanceStatisticsVisibilityPrivate       *bool             `url:"instance_statistics_visibility_private,omitempty" json:"instance_statistics_visibility_private,omitempty"`
310	LocalMarkdownVersion                      *int              `url:"local_markdown_version,omitempty" json:"local_markdown_version,omitempty"`
311	MaxArtifactsSize                          *int              `url:"max_artifacts_size,omitempty" json:"max_artifacts_size,omitempty"`
312	MaxAttachmentSize                         *int              `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"`
313	MaxPagesSize                              *int              `url:"max_pages_size,omitempty" json:"max_pages_size,omitempty"`
314	MetricsEnabled                            *bool             `url:"metrics_enabled,omitempty" json:"metrics_enabled,omitempty"`
315	MetricsHost                               *string           `url:"metrics_host,omitempty" json:"metrics_host,omitempty"`
316	MetricsMethodCallThreshold                *int              `url:"metrics_method_call_threshold,omitempty" json:"metrics_method_call_threshold,omitempty"`
317	MetricsPacketSize                         *int              `url:"metrics_packet_size,omitempty" json:"metrics_packet_size,omitempty"`
318	MetricsPoolSize                           *int              `url:"metrics_pool_size,omitempty" json:"metrics_pool_size,omitempty"`
319	MetricsPort                               *int              `url:"metrics_port,omitempty" json:"metrics_port,omitempty"`
320	MetricsSampleInterval                     *int              `url:"metrics_sample_interval,omitempty" json:"metrics_sample_interval,omitempty"`
321	MetricsTimeout                            *int              `url:"metrics_timeout,omitempty" json:"metrics_timeout,omitempty"`
322	MirrorAvailable                           *bool             `url:"mirror_available,omitempty" json:"mirror_available,omitempty"`
323	MirrorCapacityThreshold                   *int              `url:"mirror_capacity_threshold,omitempty" json:"mirror_capacity_threshold,omitempty"`
324	MirrorMaxCapacity                         *int              `url:"mirror_max_capacity,omitempty" json:"mirror_max_capacity,omitempty"`
325	MirrorMaxDelay                            *int              `url:"mirror_max_delay,omitempty" json:"mirror_max_delay,omitempty"`
326	OutboundLocalRequestsWhitelist            []string          `url:"outbound_local_requests_whitelist,omitempty" json:"outbound_local_requests_whitelist,omitempty"`
327	PagesDomainVerificationEnabled            *bool             `url:"pages_domain_verification_enabled,omitempty" json:"pages_domain_verification_enabled,omitempty"`
328	PasswordAuthenticationEnabledForGit       *bool             `url:"password_authentication_enabled_for_git,omitempty" json:"password_authentication_enabled_for_git,omitempty"`
329	PasswordAuthenticationEnabledForWeb       *bool             `url:"password_authentication_enabled_for_web,omitempty" json:"password_authentication_enabled_for_web,omitempty"`
330	PerformanceBarAllowedGroupID              *string           `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"`
331	PerformanceBarAllowedGroupPath            *string           `url:"performance_bar_allowed_group_path,omitempty" json:"performance_bar_allowed_group_path,omitempty"`
332	PerformanceBarEnabled                     *bool             `url:"performance_bar_enabled,omitempty" json:"performance_bar_enabled,omitempty"`
333	PlantumlEnabled                           *bool             `url:"plantuml_enabled,omitempty" json:"plantuml_enabled,omitempty"`
334	PlantumlURL                               *string           `url:"plantuml_url,omitempty" json:"plantuml_url,omitempty"`
335	PollingIntervalMultiplier                 *float64          `url:"polling_interval_multiplier,omitempty" json:"polling_interval_multiplier,omitempty"`
336	ProjectExportEnabled                      *bool             `url:"project_export_enabled,omitempty" json:"project_export_enabled,omitempty"`
337	PrometheusMetricsEnabled                  *bool             `url:"prometheus_metrics_enabled,omitempty" json:"prometheus_metrics_enabled,omitempty"`
338	ProtectedCIVariables                      *bool             `url:"protected_ci_variables,omitempty" json:"protected_ci_variables,omitempty"`
339	PseudonymizerEnabled                      *bool             `url:"psedonymizer_enabled,omitempty" json:"psedonymizer_enabled,omitempty"`
340	PushEventHooksLimit                       *int              `url:"push_event_hooks_limit,omitempty" json:"push_event_hooks_limit,omitempty"`
341	PushEventActivitiesLimit                  *int              `url:"push_event_activities_limit,omitempty" json:"push_event_activities_limit,omitempty"`
342	RecaptchaEnabled                          *bool             `url:"recaptcha_enabled,omitempty" json:"recaptcha_enabled,omitempty"`
343	RecaptchaPrivateKey                       *string           `url:"recaptcha_private_key,omitempty" json:"recaptcha_private_key,omitempty"`
344	RecaptchaSiteKey                          *string           `url:"recaptcha_site_key,omitempty" json:"recaptcha_site_key,omitempty"`
345	ReceiveMaxInputSize                       *int              `url:"receive_max_input_size,omitempty" json:"receive_max_input_size,omitempty"`
346	RepositoryChecksEnabled                   *bool             `url:"repository_checks_enabled,omitempty" json:"repository_checks_enabled,omitempty"`
347	RepositorySizeLimit                       *int              `url:"repository_size_limit,omitempty" json:"repository_size_limit,omitempty"`
348	RepositoryStorages                        []string          `url:"repository_storages,omitempty" json:"repository_storages,omitempty"`
349	RequireTwoFactorAuthentication            *bool             `url:"require_two_factor_authentication,omitempty" json:"require_two_factor_authentication,omitempty"`
350	RestrictedVisibilityLevels                []VisibilityValue `url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"`
351	RsaKeyRestriction                         *int              `url:"rsa_key_restriction,omitempty" json:"rsa_key_restriction,omitempty"`
352	SendUserConfirmationEmail                 *bool             `url:"send_user_confirmation_email,omitempty" json:"send_user_confirmation_email,omitempty"`
353	SessionExpireDelay                        *int              `url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"`
354	SharedRunnersEnabled                      *bool             `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
355	SharedRunnersMinutes                      *int              `url:"shared_runners_minutes,omitempty" json:"shared_runners_minutes,omitempty"`
356	SharedRunnersText                         *string           `url:"shared_runners_text,omitempty" json:"shared_runners_text,omitempty"`
357	SignInText                                *string           `url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"`
358	SignupEnabled                             *bool             `url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"`
359	SlackAppEnabled                           *bool             `url:"slack_app_enabled,omitempty" json:"slack_app_enabled,omitempty"`
360	SlackAppID                                *string           `url:"slack_app_id,omitempty" json:"slack_app_id,omitempty"`
361	SlackAppSecret                            *string           `url:"slack_app_secret,omitempty" json:"slack_app_secret,omitempty"`
362	SlackAppVerificationToken                 *string           `url:"slack_app_verification_token,omitempty" json:"slack_app_verification_token,omitempty"`
363	SnowplowCollectorHostname                 *string           `url:"snowplow_collector_hostname,omitempty" json:"snowplow_collector_hostname,omitempty"`
364	SnowplowCookieDomain                      *string           `url:"snowplow_cookie_domain,omitempty" json:"snowplow_cookie_domain,omitempty"`
365	SnowplowEnabled                           *bool             `url:"snowplow_enabled,omitempty" json:"snowplow_enabled,omitempty"`
366	SnowplowSiteID                            *string           `url:"snowplow_site_id,omitempty" json:"snowplow_site_id,omitempty"`
367	TerminalMaxSessionTime                    *int              `url:"terminal_max_session_time,omitempty" json:"terminal_max_session_time,omitempty"`
368	Terms                                     *string           `url:"terms,omitempty" json:"terms,omitempty"`
369	ThrottleAuthenticatedAPIEnabled           *bool             `url:"throttle_authenticated_api_enabled,omitempty" json:"throttle_authenticated_api_enabled,omitempty"`
370	ThrottleAuthenticatedAPIPeriodInSeconds   *int              `url:"throttle_authenticated_api_period_in_seconds,omitempty" json:"throttle_authenticated_api_period_in_seconds,omitempty"`
371	ThrottleAuthenticatedAPIRequestsPerPeriod *int              `url:"throttle_authenticated_api_requests_per_period,omitempty" json:"throttle_authenticated_api_requests_per_period,omitempty"`
372	ThrottleAuthenticatedWebEnabled           *bool             `url:"throttle_authenticated_web_enabled,omitempty" json:"throttle_authenticated_web_enabled,omitempty"`
373	ThrottleAuthenticatedWebPeriodInSeconds   *int              `url:"throttle_authenticated_web_period_in_seconds,omitempty" json:"throttle_authenticated_web_period_in_seconds,omitempty"`
374	ThrottleAuthenticatedWebRequestsPerPeriod *int              `url:"throttle_authenticated_web_requests_per_period,omitempty" json:"throttle_authenticated_web_requests_per_period,omitempty"`
375	ThrottleUnauthenticatedEnabled            *bool             `url:"throttle_unauthenticated_enabled,omitempty" json:"throttle_unauthenticated_enabled,omitempty"`
376	ThrottleUnauthenticatedPeriodInSeconds    *int              `url:"throttle_unauthenticated_period_in_seconds,omitempty" json:"throttle_unauthenticated_period_in_seconds,omitempty"`
377	ThrottleUnauthenticatedRequestsPerPeriod  *int              `url:"throttle_unauthenticated_requests_per_period,omitempty" json:"throttle_unauthenticated_requests_per_period,omitempty"`
378	TimeTrackingLimitToHours                  *bool             `url:"time_tracking_limit_to_hours,omitempty" json:"time_tracking_limit_to_hours,omitempty"`
379	TwoFactorGracePeriod                      *int              `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"`
380	UniqueIPsLimitEnabled                     *bool             `url:"unique_ips_limit_enabled,omitempty" json:"unique_ips_limit_enabled,omitempty"`
381	UniqueIPsLimitPerUser                     *int              `url:"unique_ips_limit_per_user,omitempty" json:"unique_ips_limit_per_user,omitempty"`
382	UniqueIPsLimitTimeWindow                  *int              `url:"unique_ips_limit_time_window,omitempty" json:"unique_ips_limit_time_window,omitempty"`
383	UsagePingEnabled                          *bool             `url:"usage_ping_enabled,omitempty" json:"usage_ping_enabled,omitempty"`
384	UserDefaultExternal                       *bool             `url:"user_default_external,omitempty" json:"user_default_external,omitempty"`
385	UserDefaultInternalRegex                  *string           `url:"user_default_internal_regex,omitempty" json:"user_default_internal_regex,omitempty"`
386	UserOauthApplications                     *bool             `url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"`
387	UserShowAddSSHKeyMessage                  *bool             `url:"user_show_add_ssh_key_message,omitempty" json:"user_show_add_ssh_key_message,omitempty"`
388	VersionCheckEnabled                       *bool             `url:"version_check_enabled,omitempty" json:"version_check_enabled,omitempty"`
389	WebIDEClientsidePreviewEnabled            *bool             `url:"web_ide_clientside_preview_enabled,omitempty" json:"web_ide_clientside_preview_enabled,omitempty"`
390}
391
392// UpdateSettings updates the application settings.
393//
394// GitLab API docs:
395// https://docs.gitlab.com/ce/api/settings.html#change-application.settings
396func (s *SettingsService) UpdateSettings(opt *UpdateSettingsOptions, options ...OptionFunc) (*Settings, *Response, error) {
397	req, err := s.client.NewRequest("PUT", "application/settings", opt, options)
398	if err != nil {
399		return nil, nil, err
400	}
401
402	as := new(Settings)
403	resp, err := s.client.Do(req, as)
404	if err != nil {
405		return nil, resp, err
406	}
407
408	return as, resp, err
409}