package org.wfc.omada.api.msp.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;

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

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

  @JsonProperty("name")
  private String name;

  @JsonProperty("password")
  private String password;

  @JsonProperty("email")
  private String email;

  @JsonProperty("roleId")
  private String roleId;

  @JsonProperty("customerRoleId")
  private String customerRoleId;

  @JsonProperty("allCustomer")
  private Boolean allCustomer;

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

  @JsonProperty("alert")
  private Boolean alert;

  public CreateMspUserVo 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 CreateMspUserVo name(String name) {
    this.name = name;
    return this;
  }

  /**
   * User name. When creating cloud user, you should set TP-LINK ID. It should contain 1 to 128 ASCII visible characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "User name. When creating cloud user, you should set TP-LINK ID. It should contain 1 to 128 ASCII visible characters.")
  @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 CreateMspUserVo password(String password) {
    this.password = password;
    return this;
  }

  /**
   * Password of local user should contain 8 to 128 ASCII visible 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 ASCII visible 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 CreateMspUserVo 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 CreateMspUserVo roleId(String roleId) {
    this.roleId = roleId;
    return this;
  }

  /**
   * Msp role ID of user
   * @return roleId
  */
  @ApiModelProperty(required = true, value = "Msp role ID of user")
  @NotNull


  public String getRoleId() {
    return roleId;
  }

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

  public CreateMspUserVo customerRoleId(String customerRoleId) {
    this.customerRoleId = customerRoleId;
    return this;
  }

  /**
   * Msp user's customer role ID when visit customer
   * @return customerRoleId
  */
  @ApiModelProperty(required = true, value = "Msp user's customer role ID when visit customer")
  @NotNull


  public String getCustomerRoleId() {
    return customerRoleId;
  }

  public void setCustomerRoleId(String customerRoleId) {
    this.customerRoleId = customerRoleId;
  }

  public CreateMspUserVo allCustomer(Boolean allCustomer) {
    this.allCustomer = allCustomer;
    return this;
  }

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


  public Boolean getAllCustomer() {
    return allCustomer;
  }

  public void setAllCustomer(Boolean allCustomer) {
    this.allCustomer = allCustomer;
  }

  public CreateMspUserVo customers(List<String> customers) {
    this.customers = customers;
    return this;
  }

  public CreateMspUserVo addCustomersItem(String customersItem) {
    if (this.customers == null) {
      this.customers = new ArrayList<>();
    }
    this.customers.add(customersItem);
    return this;
  }

  /**
   * User customer privilege list
   * @return customers
  */
  @ApiModelProperty(value = "User customer privilege list")


  public List<String> getCustomers() {
    return customers;
  }

  public void setCustomers(List<String> customers) {
    this.customers = customers;
  }

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

  /**
   * Whether this user want to receive alert emails
   * @return alert
  */
  @ApiModelProperty(value = "Whether this user want to receive alert emails")


  public Boolean getAlert() {
    return alert;
  }

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


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateMspUserVo createMspUserVo = (CreateMspUserVo) o;
    return Objects.equals(this.type, createMspUserVo.type) &&
        Objects.equals(this.name, createMspUserVo.name) &&
        Objects.equals(this.password, createMspUserVo.password) &&
        Objects.equals(this.email, createMspUserVo.email) &&
        Objects.equals(this.roleId, createMspUserVo.roleId) &&
        Objects.equals(this.customerRoleId, createMspUserVo.customerRoleId) &&
        Objects.equals(this.allCustomer, createMspUserVo.allCustomer) &&
        Objects.equals(this.customers, createMspUserVo.customers) &&
        Objects.equals(this.alert, createMspUserVo.alert);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, name, password, email, roleId, customerRoleId, allCustomer, customers, alert);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateMspUserVo {\n");
    
    sb.append("    type: ").append(toIndentedString(type)).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("    roleId: ").append(toIndentedString(roleId)).append("\n");
    sb.append("    customerRoleId: ").append(toIndentedString(customerRoleId)).append("\n");
    sb.append("    allCustomer: ").append(toIndentedString(allCustomer)).append("\n");
    sb.append("    customers: ").append(toIndentedString(customers)).append("\n");
    sb.append("    alert: ").append(toIndentedString(alert)).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    ");
  }
}

