3 * Copyright (C) 2009-2024 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.server.v2.api.gitlab.config.request;
22 import io.swagger.v3.oas.annotations.media.ArraySchema;
23 import io.swagger.v3.oas.annotations.media.Schema;
24 import java.util.List;
25 import javax.validation.constraints.Size;
26 import org.sonar.server.v2.api.gitlab.config.resource.ProvisioningType;
27 import org.sonar.server.v2.common.model.UpdateField;
29 public class GitlabConfigurationUpdateRestRequest {
31 private UpdateField<Boolean> enabled = UpdateField.undefined();
32 private UpdateField<String> applicationId = UpdateField.undefined();
33 private UpdateField<String> url = UpdateField.undefined();
34 private UpdateField<String> secret = UpdateField.undefined();
35 private UpdateField<Boolean> synchronizeGroups = UpdateField.undefined();
36 private UpdateField<ProvisioningType> provisioningType = UpdateField.undefined();
37 private UpdateField<Boolean> allowUsersToSignUp = UpdateField.undefined();
38 private UpdateField<String> provisioningToken = UpdateField.undefined();
39 private UpdateField<List<String>> provisioningGroups = UpdateField.undefined();
41 @Schema(implementation = Boolean.class, description = "Enable Gitlab authentication")
42 public UpdateField<Boolean> getEnabled() {
46 public void setEnabled(Boolean enabled) {
47 this.enabled = UpdateField.withValue(enabled);
50 @Schema(implementation = String.class, description = "Gitlab Application id")
51 public UpdateField<String> getApplicationId() {
55 public void setApplicationId(String applicationId) {
56 this.applicationId = UpdateField.withValue(applicationId);
59 @Schema(implementation = String.class, description = "Url of Gitlab instance for authentication (for instance https://gitlab.com/api/v4)")
60 public UpdateField<String> getUrl() {
64 public void setUrl(String url) {
65 this.url = UpdateField.withValue(url);
68 @Schema(implementation = String.class, description = "Secret of the application", nullable = true)
69 public UpdateField<String> getSecret() {
73 public void setSecret(String secret) {
74 this.secret = UpdateField.withValue(secret);
77 @Schema(implementation = Boolean.class, description = "Set whether to synchronize groups")
78 public UpdateField<Boolean> getSynchronizeGroups() {
79 return synchronizeGroups;
82 public void setSynchronizeGroups(Boolean synchronizeGroups) {
83 this.synchronizeGroups = UpdateField.withValue(synchronizeGroups);
86 @Schema(implementation = ProvisioningType.class, description = "Type of synchronization")
87 public UpdateField<ProvisioningType> getProvisioningType() {
88 return provisioningType;
91 public void setProvisioningType(ProvisioningType provisioningType) {
92 this.provisioningType = UpdateField.withValue(provisioningType);
95 @Schema(implementation = Boolean.class, description = "Allow user to sign up")
96 public UpdateField<Boolean> getAllowUsersToSignUp() {
97 return allowUsersToSignUp;
100 public void setAllowUsersToSignUp(Boolean allowUsersToSignUp) {
101 this.allowUsersToSignUp = UpdateField.withValue(allowUsersToSignUp);
105 @Schema(implementation = String.class, description = "Gitlab token for provisioning", nullable = true)
106 public UpdateField<String> getProvisioningToken() {
107 return provisioningToken;
110 public void setProvisioningToken(String provisioningToken) {
111 this.provisioningToken = UpdateField.withValue(provisioningToken);
114 @ArraySchema(arraySchema = @Schema(description = "Root gitlab groups to provision."), schema = @Schema(implementation = String.class))
115 public UpdateField<List<String>> getProvisioningGroups() {
116 return provisioningGroups;
119 public void setProvisioningGroups(List<String> provisioningGroups) {
120 this.provisioningGroups = UpdateField.withValue(provisioningGroups);