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.user.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.Email;
26 import javax.validation.constraints.Size;
27 import org.sonar.server.v2.common.model.UpdateField;
29 public class UserUpdateRestRequest {
31 private UpdateField<String> login = UpdateField.undefined();
32 private UpdateField<String> name = UpdateField.undefined();
33 private UpdateField<String> email = UpdateField.undefined();
34 private UpdateField<List<String>> scmAccounts = UpdateField.undefined();
36 @Size(min = 2, max = 100)
37 @Schema(description = "User login")
38 public UpdateField<String> getLogin() {
42 public void setLogin(String login) {
43 this.login = UpdateField.withValue(login);
47 @Schema(description = "User first name and last name", implementation = String.class)
48 public UpdateField<String> getName() {
52 public void setName(String name) {
53 this.name = UpdateField.withValue(name);
57 @Size(min = 1, max = 100)
58 @Schema(implementation = String.class, description = "Email")
59 public UpdateField<String> getEmail() {
63 public void setEmail(String email) {
64 this.email = UpdateField.withValue(email);
67 @ArraySchema(arraySchema = @Schema(description = "List of SCM accounts."), schema = @Schema(implementation = String.class))
68 public UpdateField<List<String>> getScmAccounts() {
72 public void setScmAccounts(List<String> scmAccounts) {
73 this.scmAccounts = UpdateField.withValue(scmAccounts);