View Javadoc
1   package fr.tiogars.domaintemplate.domains.auth.user.models;
2   
3   import java.util.Set;
4   
5   import io.swagger.v3.oas.annotations.media.Schema;
6   import jakarta.validation.constraints.NotBlank;
7   import jakarta.validation.constraints.NotEmpty;
8   import jakarta.validation.constraints.NotNull;
9   
10  /** Request body used to update a user account. */
11  public record UpdateUserRequest(
12          @Schema(
13                  description = "Unique login name.",
14                  example = "operator",
15                  requiredMode = Schema.RequiredMode.REQUIRED)
16          @NotBlank
17          String username,
18          @Schema(description = "Replacement plain password. Omit or leave blank to keep the current password.")
19          String password,
20          @Schema(
21                  description = "Whether this account can authenticate.",
22                  example = "true",
23                  requiredMode = Schema.RequiredMode.REQUIRED)
24          @NotNull
25          Boolean enabled,
26          @Schema(
27                  description = "Role codes assigned to this account.",
28                  example = "[\"USER\"]",
29                  requiredMode = Schema.RequiredMode.REQUIRED)
30          @NotEmpty
31          Set<@NotBlank String> roles) {
32  }