package org.wfc.omada.api.account.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * CreateUserVo
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T10:44:52.771+08:00[Asia/Shanghai]")

public class CreateUserVo   {
  @JsonProperty("type")
  private Integer type;

  @JsonProperty("roleId")
  private String roleId;

  @JsonProperty("name")
  private String name;

  @JsonProperty("password")
  private String password;

  @JsonProperty("email")
  private String email;

  @JsonProperty("alert")
  private Boolean alert;

  @JsonProperty("incidentNotification")
  private Boolean incidentNotification;

  @JsonProperty("sites")
  @Valid
  private List<String> sites = null;

  @JsonProperty("allSite")
  private Boolean allSite;

  public CreateUserVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * Type of user should be a value as follows: 0: local user; 1: cloud user.
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type of user should be a value as follows: 0: local user; 1: cloud user.")
  @NotNull


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public CreateUserVo roleId(String roleId) {
    this.roleId = roleId;
    return this;
  }

  /**
   * This field represents Role ID. Role can be created using 'Create new role' interface, and Role ID can be obtained from 'Get role list' interface.
   * @return roleId
  */
  @ApiModelProperty(required = true, value = "This field represents Role ID. Role can be created using 'Create new role' interface, and Role ID can be obtained from 'Get role list' interface.")
  @NotNull


  public String getRoleId() {
    return roleId;
  }

  public void setRoleId(String roleId) {
    this.roleId = roleId;
  }

  public CreateUserVo name(String name) {
    this.name = name;
    return this;
  }

  /**
   * User name should contain 1 to 128 characters. When creating cloud user, you should set TP-LINK ID.
   * @return name
  */
  @ApiModelProperty(required = true, value = "User name should contain 1 to 128 characters. When creating cloud user, you should set TP-LINK ID.")
  @NotNull

@Pattern(regexp="^[\\041-\\0176]$|^[\\041-\\0176][\\040-\\0176]{0,126}[\\041-\\0176]$") 
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public CreateUserVo password(String password) {
    this.password = password;
    return this;
  }

  /**
   * Password of local user should contain 8 to 128 characters. And password must be a combination of uppercase letters, lowercase letters, numbers, and special symbols. Symbols such as ! # $ % & * @ ^ are supported.
   * @return password
  */
  @ApiModelProperty(value = "Password of local user should contain 8 to 128 characters. And password must be a combination of uppercase letters, lowercase letters, numbers, and special symbols. Symbols such as ! # $ % & * @ ^ are supported.")

@Pattern(regexp="^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[\\!\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\./\\:\\;\\<\\=\\>\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~])(?!.*[\\00-\\040\\042\\077\\0177]).{8,128}$") 
  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public CreateUserVo email(String email) {
    this.email = email;
    return this;
  }

  /**
   * Email of user.
   * @return email
  */
  @ApiModelProperty(value = "Email of user.")


  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public CreateUserVo alert(Boolean alert) {
    this.alert = alert;
    return this;
  }

  /**
   * Whether this user want to receive alert emails. Make sure your email is not null
   * @return alert
  */
  @ApiModelProperty(value = "Whether this user want to receive alert emails. Make sure your email is not null")


  public Boolean getAlert() {
    return alert;
  }

  public void setAlert(Boolean alert) {
    this.alert = alert;
  }

  public CreateUserVo incidentNotification(Boolean incidentNotification) {
    this.incidentNotification = incidentNotification;
    return this;
  }

  /**
   * Incident notification
   * @return incidentNotification
  */
  @ApiModelProperty(value = "Incident notification")


  public Boolean getIncidentNotification() {
    return incidentNotification;
  }

  public void setIncidentNotification(Boolean incidentNotification) {
    this.incidentNotification = incidentNotification;
  }

  public CreateUserVo sites(List<String> sites) {
    this.sites = sites;
    return this;
  }

  public CreateUserVo addSitesItem(String sitesItem) {
    if (this.sites == null) {
      this.sites = new ArrayList<>();
    }
    this.sites.add(sitesItem);
    return this;
  }

  /**
   * User site privilege list
   * @return sites
  */
  @ApiModelProperty(value = "User site privilege list")


  public List<String> getSites() {
    return sites;
  }

  public void setSites(List<String> sites) {
    this.sites = sites;
  }

  public CreateUserVo allSite(Boolean allSite) {
    this.allSite = allSite;
    return this;
  }

  /**
   * Whether user has all site permission, including new created site.
   * @return allSite
  */
  @ApiModelProperty(required = true, value = "Whether user has all site permission, including new created site.")
  @NotNull


  public Boolean getAllSite() {
    return allSite;
  }

  public void setAllSite(Boolean allSite) {
    this.allSite = allSite;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateUserVo createUserVo = (CreateUserVo) o;
    return Objects.equals(this.type, createUserVo.type) &&
        Objects.equals(this.roleId, createUserVo.roleId) &&
        Objects.equals(this.name, createUserVo.name) &&
        Objects.equals(this.password, createUserVo.password) &&
        Objects.equals(this.email, createUserVo.email) &&
        Objects.equals(this.alert, createUserVo.alert) &&
        Objects.equals(this.incidentNotification, createUserVo.incidentNotification) &&
        Objects.equals(this.sites, createUserVo.sites) &&
        Objects.equals(this.allSite, createUserVo.allSite);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, roleId, name, password, email, alert, incidentNotification, sites, allSite);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateUserVo {\n");
    
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    roleId: ").append(toIndentedString(roleId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    email: ").append(toIndentedString(email)).append("\n");
    sb.append("    alert: ").append(toIndentedString(alert)).append("\n");
    sb.append("    incidentNotification: ").append(toIndentedString(incidentNotification)).append("\n");
    sb.append("    sites: ").append(toIndentedString(sites)).append("\n");
    sb.append("    allSite: ").append(toIndentedString(allSite)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

