Commit e6f4b9d4 authored by mickymiek's avatar mickymiek Committed by Sander van Harmelen

updated Settings and UpdateSettingsOptions (#232)

parent 583972b2
...@@ -30,25 +30,98 @@ type SettingsService struct { ...@@ -30,25 +30,98 @@ type SettingsService struct {
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/settings.html // GitLab API docs: https://docs.gitlab.com/ce/api/settings.html
type Settings struct { type Settings struct {
ID int `json:"id"` ID int `json:"id"`
DefaultProjectsLimit int `json:"default_projects_limit"` CreatedAt *time.Time `json:"created_at"`
SignupEnabled bool `json:"signup_enabled"` UpdatedAt *time.Time `json:"updated_at"`
SigninEnabled bool `json:"signin_enabled"` AdminNotificationEmail string `json:"admin_notification_email"`
GravatarEnabled bool `json:"gravatar_enabled"` AfterSignOutPath string `json:"after_sign_out_path"`
SignInText string `json:"sign_in_text"` AfterSignUpText string `json:"after_sign_up_text"`
CreatedAt *time.Time `json:"created_at"` AkismetApiKey string `json:"akismet_api_key"`
UpdatedAt *time.Time `json:"updated_at"` AkismetEnabled bool `json:"akismet_enabled"`
HomePageURL string `json:"home_page_url"` CircuitbreakerAccessRetries int `json:"circuitbreaker_access_retries"`
DefaultBranchProtection int `json:"default_branch_protection"` CircuitbreakerBackoffThreshold int `json:"circuitbreaker_backoff_threshold"`
TwitterSharingEnabled bool `json:"twitter_sharing_enabled"` CircuitbreakerFailureCountThreshold int `json:"circuitbreaker_failure_count_threshold"`
RestrictedVisibilityLevels []VisibilityValue `json:"restricted_visibility_levels"` CircuitbreakerFailureResetTime int `json:"circuitbreaker_failure_reset_time"`
MaxAttachmentSize int `json:"max_attachment_size"` CircuitbreakerFailureWaitTime int `json:"circuitbreaker_failure_wait_time"`
SessionExpireDelay int `json:"session_expire_delay"` CircuitbreakerStorageTimeout int `json:"circuitbreaker_storage_timeout"`
DefaultProjectVisibility int `json:"default_project_visibility"` ClientsideSentryDSN string `json:"clientside_sentry_dsn"`
DefaultSnippetVisibility int `json:"default_snippet_visibility"` ClientsideSentryEnabled bool `json:"clientside_sentry_enabled"`
RestrictedSignupDomains []string `json:"restricted_signup_domains"` ContainerRegistryTokenExpireDelay int `json:"container_registry_token_expire_delay"`
UserOauthApplications bool `json:"user_oauth_applications"` DefaultArtifactsExpireIn string `json:"default_artifacts_expire_in"`
AfterSignOutPath string `json:"after_sign_out_path"` DefaultBranchProtection int `json:"default_branch_protection"`
DefaultGroupVisibility string `json:"default_group_visibility"`
DefaultProjectVisibility string `json:"default_project_visibility"`
DefaultProjectsLimit int `json:"default_projects_limit"`
DefaultSnippetVisibility string `json:"default_snippet_visibility"`
DisabledOauthSignInSources []string `json:"disabled_oauth_sign_in_sources"`
DomainBlacklistEnabled bool `json:"domain_blacklist_enabled"`
DomainBlacklist []string `json:"domain_blacklist"`
DomainWhitelist []string `json:"domain_whitelist"`
DSAKeyRestriction int `json:"dsa_key_restriction"`
ECDSAKeyRestriction int `json:"ecdsa_key_restriction"`
Ed25519KeyRestriction int `json:"ed25519_key_restriction"`
EmailAuthorInBody bool `json:"email_author_in_body"`
EnabledGitAccessProtocol string `json:"enabled_git_access_protocol"`
GravatarEnabled bool `json:"gravatar_enabled"`
HelpPageHideCommercialContent bool `json:"help_page_hide_commercial_content"`
HelpPageSupportURL string `json:"help_page_support_url"`
HomePageURL string `json:"home_page_url"`
HousekeepingBitmapsEnabled bool `json:"housekeeping_bitmaps_enabled"`
HousekeepingEnabled bool `json:"housekeeping_enabled"`
HousekeepingFullRepackPeriod int `json:"housekeeping_full_repack_period"`
HousekeepingGcPeriod int `json:"housekeeping_gc_period"`
HousekeepingIncrementalRepackPeriod int `json:"housekeeping_incremental_repack_period"`
HTMLEmailsEnabled bool `json:"html_emails_enabled"`
ImportSources []string `json:"import_sources"`
KodingEnabled bool `json:"koding_enabled"`
KodingURL string `json:"koding_url"`
MaxArtifactsSize int `json:"max_artifacts_size"`
MaxAttachmentSize int `json:"max_attachment_size"`
MaxPagesSize int `json:"max_pages_size"`
MetricsEnabled bool `json:"metrics_enabled"`
MetricsHost string `json:"metrics_host"`
MetricsMethodCallThreshold int `json:"metrics_method_call_threshold"`
MetricsPacketSize int `json:"metrics_packet_size"`
MetricsPoolSize int `json:"metrics_pool_size"`
MetricsPort int `json:"metrics_port"`
MetricsSampleInterval int `json:"metrics_sample_interval"`
MetricsTimeout int `json:"metrics_timeout"`
PasswordAuthenticationEnabled bool `json:"password_authentication_enabled"`
PerformanceBarAllowedGroupId string `json:"performance_bar_allowed_group_id"`
PerformanceBarEnabled bool `json:"performance_bar_enabled"`
PlantumlEnabled bool `json:"plantuml_enabled"`
PlantumlURL string `json:"plantuml_url"`
PollingIntervalMultiplier float64 `json:"polling_interval_multiplier"`
ProjectExportEnabled bool `json:"project_export_enabled"`
PrometheusMetricsEnabled bool `json:"prometheus_metrics_enabled"`
RecaptchaEnabled bool `json:"recaptcha_enabled"`
RecaptchaPrivateKey string `json:"recaptcha_private_key"`
RecaptchaSiteKey string `json:"recaptcha_site_key"`
RepositoryChecksEnabled bool `json:"repository_checks_enabled"`
RepositoryStorages []string `json:"repository_storages"`
RequireTwoFactorAuthentication bool `json:"require_two_factor_authentication"`
RestrictedVisibilityLevels []VisibilityValue `json:"restricted_visibility_levels"`
RsaKeyRestriction int `json:"rsa_key_restriction"`
SendUserConfirmationEmail bool `json:"send_user_confirmation_email"`
SentryDSN string `json:"sentry_dsn"`
SentryEnabled bool `json:"sentry_enabled"`
SessionExpireDelay int `json:"session_expire_delay"`
SharedRunnersEnabled bool `json:"shared_runners_enabled"`
SharedRunnersText string `json:"shared_runners_text"`
SidekiqThrottlingEnabled bool `json:"sidekiq_throttling_enabled"`
SidekiqThrottlingFactor float64 `json:"sidekiq_throttling_factor"`
SidekiqThrottlingQueues []string `json:"sidekiq_throttling_queues"`
SignInText string `json:"sign_in_text"`
SignupEnabled bool `json:"signup_enabled"`
TerminalMaxSessionTime int `json:"terminal_max_session_time"`
TwoFactorGracePeriod int `json:"two_factor_grace_period"`
UniqueIPsLimitEnabled bool `json:"unique_ips_limit_enabled"`
UniqueIPsLimitPerUser int `json:"unique_ips_limit_per_user"`
UniqueIPsLimitTimeWindow int `json:"unique_ips_limit_time_window"`
UsagePingEnabled bool `json:"usage_ping_enabled"`
UserDefaultExternal bool `json:"user_default_external"`
UserOauthApplications bool `json:"user_oauth_applications"`
VersionCheckEnabled bool `json:"version_check_enabled"`
} }
func (s Settings) String() string { func (s Settings) String() string {
...@@ -79,22 +152,95 @@ func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Respon ...@@ -79,22 +152,95 @@ func (s *SettingsService) GetSettings(options ...OptionFunc) (*Settings, *Respon
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/settings.html#change-application.settings // https://docs.gitlab.com/ce/api/settings.html#change-application.settings
type UpdateSettingsOptions struct { type UpdateSettingsOptions struct {
DefaultProjectsLimit *int `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"` AdminNotificationEmail *string `url:"admin_notification_email,omitempty" json:"admin_notification_email,omitempty"`
SignupEnabled *bool `url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"` AfterSignOutPath *string `url:"after_sign_out_path,omitempty" json:"after_sign_out_path,omitempty"`
SigninEnabled *bool `url:"signin_enabled,omitempty" json:"signin_enabled,omitempty"` AfterSignUpText *string `url:"after_sign_up_text,omitempty" json:"after_sign_up_text,omitempty"`
GravatarEnabled *bool `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"` AkismetApiKey *string `url:"akismet_api_key,omitempty" json:"akismet_api_key,omitempty"`
SignInText *string `url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"` AkismetEnabled *bool `url:"akismet_enabled,omitempty" json:"akismet_enabled,omitempty"`
HomePageURL *string `url:"home_page_url,omitempty" json:"home_page_url,omitempty"` CircuitbreakerAccessRetries *int `url:"circuitbreaker_access_retries,omitempty" json:"circuitbreaker_access_retries,omitempty"`
DefaultBranchProtection *int `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"` CircuitbreakerBackoffThreshold *int `url:"circuitbreaker_backoff_threshold,omitempty" json:"circuitbreaker_backoff_threshold,omitempty"`
TwitterSharingEnabled *bool `url:"twitter_sharing_enabled,omitempty" json:"twitter_sharing_enabled,omitempty"` CircuitbreakerFailureCountThreshold *int `url:"circuitbreaker_failure_count_threshold,omitempty" json:"circuitbreaker_failure_count_threshold,omitempty"`
RestrictedVisibilityLevels []VisibilityValue `url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"` CircuitbreakerFailureResetTime *int `url:"circuitbreaker_failure_reset_time,omitempty" json:"circuitbreaker_failure_reset_time,omitempty"`
MaxAttachmentSize *int `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"` CircuitbreakerFailureWaitTime *int `url:"circuitbreaker_failure_wait_time,omitempty" json:"circuitbreaker_failure_wait_time,omitempty"`
SessionExpireDelay *int `url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"` CircuitbreakerStorageTimeout *int `url:"circuitbreaker_storage_timeout,omitempty" json:"circuitbreaker_storage_timeout,omitempty"`
DefaultProjectVisibility *int `url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"` ClientsideSentryDSN *string `url:"clientside_sentry_dsn,omitempty" json:"clientside_sentry_dsn,omitempty"`
DefaultSnippetVisibility *int `url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"` ClientsideSentryEnabled *bool `url:"clientside_sentry_enabled,omitempty" json:"clientside_sentry_enabled,omitempty"`
RestrictedSignupDomains []string `url:"restricted_signup_domains,omitempty" json:"restricted_signup_domains,omitempty"` ContainerRegistryTokenExpireDelay *int `url:"container_registry_token_expire_delay,omitempty" json:"container_registry_token_expire_delay,omitempty"`
UserOauthApplications *bool `url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"` DefaultArtifactsExpireIn *string `url:"default_artifacts_expire_in,omitempty" json:"default_artifacts_expire_in,omitempty"`
AfterSignOutPath *string `url:"after_sign_out_path,omitempty" json:"after_sign_out_path,omitempty"` DefaultBranchProtection *int `url:"default_branch_protection,omitempty" json:"default_branch_protection,omitempty"`
DefaultGroupVisibility *string `url:"default_group_visibility,omitempty" json:"default_group_visibility,omitempty"`
DefaultProjectVisibility *string `url:"default_project_visibility,omitempty" json:"default_project_visibility,omitempty"`
DefaultProjectsLimit *int `url:"default_projects_limit,omitempty" json:"default_projects_limit,omitempty"`
DefaultSnippetVisibility *string `url:"default_snippet_visibility,omitempty" json:"default_snippet_visibility,omitempty"`
DisabledOauthSignInSources []string `url:"disabled_oauth_sign_in_sources,omitempty" json:"disabled_oauth_sign_in_sources,omitempty"`
DomainBlacklistEnabled *bool `url:"domain_blacklist_enabled,omitempty" json:"domain_blacklist_enabled,omitempty"`
DomainBlacklist []string `url:"domain_blacklist,omitempty" json:"domain_blacklist,omitempty"`
DomainWhitelist []string `url:"domain_whitelist,omitempty" json:"domain_whitelist,omitempty"`
DSAKeyRestriction *int `url:"dsa_key_restriction,omitempty" json:"dsa_key_restriction,omitempty"`
ECDSAKeyRestriction *int `url:"ecdsa_key_restriction,omitempty" json:"ecdsa_key_restriction,omitempty"`
Ed25519KeyRestriction *int `url:"ed25519_key_restriction,omitempty" json:"ed25519_key_restriction,omitempty"`
EmailAuthorInBody *bool `url:"email_author_in_body,omitempty" json:"email_author_in_body,omitempty"`
EnabledGitAccessProtocol *string `url:"enabled_git_access_protocol,omitempty" json:"enabled_git_access_protocol,omitempty"`
GravatarEnabled *bool `url:"gravatar_enabled,omitempty" json:"gravatar_enabled,omitempty"`
HelpPageHideCommercialContent *bool `url:"help_page_hide_commercial_content,omitempty" json:"help_page_hide_commercial_content,omitempty"`
HelpPageSupportURL *string `url:"help_page_support_url,omitempty" json:"help_page_support_url,omitempty"`
HomePageURL *string `url:"home_page_url,omitempty" json:"home_page_url,omitempty"`
HousekeepingBitmapsEnabled *bool `url:"housekeeping_bitmaps_enabled,omitempty" json:"housekeeping_bitmaps_enabled,omitempty"`
HousekeepingEnabled *bool `url:"housekeeping_enabled,omitempty" json:"housekeeping_enabled,omitempty"`
HousekeepingFullRepackPeriod *int `url:"housekeeping_full_repack_period,omitempty" json:"housekeeping_full_repack_period,omitempty"`
HousekeepingGcPeriod *int `url:"housekeeping_gc_period,omitempty" json:"housekeeping_gc_period,omitempty"`
HousekeepingIncrementalRepackPeriod *int `url:"housekeeping_incremental_repack_period,omitempty" json:"housekeeping_incremental_repack_period,omitempty"`
HTMLEmailsEnabled *bool `url:"html_emails_enabled,omitempty" json:"html_emails_enabled,omitempty"`
ImportSources []string `url:"import_sources,omitempty" json:"import_sources,omitempty"`
KodingEnabled *bool `url:"koding_enabled,omitempty" json:"koding_enabled,omitempty"`
KodingURL *string `url:"koding_url,omitempty" json:"koding_url,omitempty"`
MaxArtifactsSize *int `url:"max_artifacts_size,omitempty" json:"max_artifacts_size,omitempty"`
MaxAttachmentSize *int `url:"max_attachment_size,omitempty" json:"max_attachment_size,omitempty"`
MaxPagesSize *int `url:"max_pages_size,omitempty" json:"max_pages_size,omitempty"`
MetricsEnabled *bool `url:"metrics_enabled,omitempty" json:"metrics_enabled,omitempty"`
MetricsHost *string `url:"metrics_host,omitempty" json:"metrics_host,omitempty"`
MetricsMethodCallThreshold *int `url:"metrics_method_call_threshold,omitempty" json:"metrics_method_call_threshold,omitempty"`
MetricsPacketSize *int `url:"metrics_packet_size,omitempty" json:"metrics_packet_size,omitempty"`
MetricsPoolSize *int `url:"metrics_pool_size,omitempty" json:"metrics_pool_size,omitempty"`
MetricsPort *int `url:"metrics_port,omitempty" json:"metrics_port,omitempty"`
MetricsSampleInterval *int `url:"metrics_sample_interval,omitempty" json:"metrics_sample_interval,omitempty"`
MetricsTimeout *int `url:"metrics_timeout,omitempty" json:"metrics_timeout,omitempty"`
PasswordAuthenticationEnabled *bool `url:"password_authentication_enabled,omitempty" json:"password_authentication_enabled,omitempty"`
PerformanceBarAllowedGroupId *string `url:"performance_bar_allowed_group_id,omitempty" json:"performance_bar_allowed_group_id,omitempty"`
PerformanceBarEnabled *bool `url:"performance_bar_enabled,omitempty" json:"performance_bar_enabled,omitempty"`
PlantumlEnabled *bool `url:"plantuml_enabled,omitempty" json:"plantuml_enabled,omitempty"`
PlantumlURL *string `url:"plantuml_url,omitempty" json:"plantuml_url,omitempty"`
PollingIntervalMultiplier *float64 `url:"polling_interval_multiplier,omitempty" json:"polling_interval_multiplier,omitempty"`
ProjectExportEnabled *bool `url:"project_export_enabled,omitempty" json:"project_export_enabled,omitempty"`
PrometheusMetricsEnabled *bool `url:"prometheus_metrics_enabled,omitempty" json:"prometheus_metrics_enabled,omitempty"`
RecaptchaEnabled *bool `url:"recaptcha_enabled,omitempty" json:"recaptcha_enabled,omitempty"`
RecaptchaPrivateKey *string `url:"recaptcha_private_key,omitempty" json:"recaptcha_private_key,omitempty"`
RecaptchaSiteKey *string `url:"recaptcha_site_key,omitempty" json:"recaptcha_site_key,omitempty"`
RepositoryChecksEnabled *bool `url:"repository_checks_enabled,omitempty" json:"repository_checks_enabled,omitempty"`
RepositoryStorages []string `url:"repository_storages,omitempty" json:"repository_storages,omitempty"`
RequireTwoFactorAuthentication *bool `url:"require_two_factor_authentication,omitempty" json:"require_two_factor_authentication,omitempty"`
RestrictedVisibilityLevels []VisibilityValue `url:"restricted_visibility_levels,omitempty" json:"restricted_visibility_levels,omitempty"`
RsaKeyRestriction *int `url:"rsa_key_restriction,omitempty" json:"rsa_key_restriction,omitempty"`
SendUserConfirmationEmail *bool `url:"send_user_confirmation_email,omitempty" json:"send_user_confirmation_email,omitempty"`
SentryDSN *string `url:"sentry_dsn,omitempty" json:"sentry_dsn,omitempty"`
SentryEnabled *bool `url:"sentry_enabled,omitempty" json:"sentry_enabled,omitempty"`
SessionExpireDelay *int `url:"session_expire_delay,omitempty" json:"session_expire_delay,omitempty"`
SharedRunnersEnabled *bool `url:"shared_runners_enabled,omitempty" json:"shared_runners_enabled,omitempty"`
SharedRunnersText *string `url:"shared_runners_text,omitempty" json:"shared_runners_text,omitempty"`
SidekiqThrottlingEnabled *bool `url:"sidekiq_throttling_enabled,omitempty" json:"sidekiq_throttling_enabled,omitempty"`
SidekiqThrottlingFactor *float64 `url:"sidekiq_throttling_factor,omitempty" json:"sidekiq_throttling_factor,omitempty"`
SidekiqThrottlingQueues []string `url:"sidekiq_throttling_queues,omitempty" json:"sidekiq_throttling_queues,omitempty"`
SignInText *string `url:"sign_in_text,omitempty" json:"sign_in_text,omitempty"`
SignupEnabled *bool `url:"signup_enabled,omitempty" json:"signup_enabled,omitempty"`
TerminalMaxSessionTime *int `url:"terminal_max_session_time,omitempty" json:"terminal_max_session_time,omitempty"`
TwoFactorGracePeriod *int `url:"two_factor_grace_period,omitempty" json:"two_factor_grace_period,omitempty"`
UniqueIPsLimitEnabled *bool `url:"unique_ips_limit_enabled,omitempty" json:"unique_ips_limit_enabled,omitempty"`
UniqueIPsLimitPerUser *int `url:"unique_ips_limit_per_user,omitempty" json:"unique_ips_limit_per_user,omitempty"`
UniqueIPsLimitTimeWindow *int `url:"unique_ips_limit_time_window,omitempty" json:"unique_ips_limit_time_window,omitempty"`
UsagePingEnabled *bool `url:"usage_ping_enabled,omitempty" json:"usage_ping_enabled,omitempty"`
UserDefaultExternal *bool `url:"user_default_external,omitempty" json:"user_default_external,omitempty"`
UserOauthApplications *bool `url:"user_oauth_applications,omitempty" json:"user_oauth_applications,omitempty"`
VersionCheckEnabled *bool `url:"version_check_enabled,omitempty" json:"version_check_enabled,omitempty"`
} }
// UpdateSettings updates the application settings. // UpdateSettings updates the application settings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment