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

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

public class CreateLocalUserOpenApiVo   {
  @JsonProperty("userName")
  private String userName;

  @JsonProperty("password")
  private String password;

  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("expirationTime")
  private Long expirationTime;

  @JsonProperty("bindingType")
  private Integer bindingType;

  @JsonProperty("macAddress")
  private String macAddress;

  @JsonProperty("maxUsers")
  private Integer maxUsers;

  @JsonProperty("name")
  private String name;

  @JsonProperty("phone")
  private String phone;

  @JsonProperty("rateLimit")
  private RateLimitOpenApiVo rateLimit;

  @JsonProperty("trafficLimitEnable")
  private Boolean trafficLimitEnable;

  @JsonProperty("trafficLimit")
  private Long trafficLimit;

  @JsonProperty("trafficLimitFrequency")
  private Integer trafficLimitFrequency;

  @JsonProperty("portals")
  @Valid
  private List<String> portals = new ArrayList<>();

  public CreateLocalUserOpenApiVo userName(String userName) {
    this.userName = userName;
    return this;
  }

  /**
   * User name should contain 1 to 128 ASCII visible characters, with no spaces at the beginning and end, and spaces in the middle
   * @return userName
  */
  @ApiModelProperty(required = true, value = "User name should contain 1 to 128 ASCII visible characters, with no spaces at the beginning and end, and spaces in the middle")
  @NotNull

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

  public void setUserName(String userName) {
    this.userName = userName;
  }

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

  /**
   * Password should contain 1 to 128 characters.
   * @return password
  */
  @ApiModelProperty(required = true, value = "Password should contain 1 to 128 characters.")
  @NotNull


  public String getPassword() {
    return password;
  }

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

  public CreateLocalUserOpenApiVo enable(Boolean enable) {
    this.enable = enable;
    return this;
  }

  /**
   * Whether to enable.
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Whether to enable.")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

  public CreateLocalUserOpenApiVo expirationTime(Long expirationTime) {
    this.expirationTime = expirationTime;
    return this;
  }

  /**
   * Expiration timestamp. Unit:ms.
   * @return expirationTime
  */
  @ApiModelProperty(required = true, value = "Expiration timestamp. Unit:ms.")
  @NotNull


  public Long getExpirationTime() {
    return expirationTime;
  }

  public void setExpirationTime(Long expirationTime) {
    this.expirationTime = expirationTime;
  }

  public CreateLocalUserOpenApiVo bindingType(Integer bindingType) {
    this.bindingType = bindingType;
    return this;
  }

  /**
   * MAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding.
   * @return bindingType
  */
  @ApiModelProperty(required = true, value = "MAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding.")
  @NotNull


  public Integer getBindingType() {
    return bindingType;
  }

  public void setBindingType(Integer bindingType) {
    this.bindingType = bindingType;
  }

  public CreateLocalUserOpenApiVo macAddress(String macAddress) {
    this.macAddress = macAddress;
    return this;
  }

  /**
   * Mac address,the value is only available when the macType is static binding or dynamic binding.
   * @return macAddress
  */
  @ApiModelProperty(value = "Mac address,the value is only available when the macType is static binding or dynamic binding.")


  public String getMacAddress() {
    return macAddress;
  }

  public void setMacAddress(String macAddress) {
    this.macAddress = macAddress;
  }

  public CreateLocalUserOpenApiVo maxUsers(Integer maxUsers) {
    this.maxUsers = maxUsers;
    return this;
  }

  /**
   * The maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048.
   * @return maxUsers
  */
  @ApiModelProperty(required = true, value = "The maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048.")
  @NotNull


  public Integer getMaxUsers() {
    return maxUsers;
  }

  public void setMaxUsers(Integer maxUsers) {
    this.maxUsers = maxUsers;
  }

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

  /**
   * Name should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle
   * @return name
  */
  @ApiModelProperty(value = "Name should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle")

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

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

  public CreateLocalUserOpenApiVo phone(String phone) {
    this.phone = phone;
    return this;
  }

  /**
   * Phone number should contain 1 to 20 characters.
   * @return phone
  */
  @ApiModelProperty(value = "Phone number should contain 1 to 20 characters.")


  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public CreateLocalUserOpenApiVo rateLimit(RateLimitOpenApiVo rateLimit) {
    this.rateLimit = rateLimit;
    return this;
  }

  /**
   * Get rateLimit
   * @return rateLimit
  */
  @ApiModelProperty(required = true, value = "")
  @NotNull

  @Valid

  public RateLimitOpenApiVo getRateLimit() {
    return rateLimit;
  }

  public void setRateLimit(RateLimitOpenApiVo rateLimit) {
    this.rateLimit = rateLimit;
  }

  public CreateLocalUserOpenApiVo trafficLimitEnable(Boolean trafficLimitEnable) {
    this.trafficLimitEnable = trafficLimitEnable;
    return this;
  }

  /**
   * Whether to enable traffic limit.
   * @return trafficLimitEnable
  */
  @ApiModelProperty(required = true, value = "Whether to enable traffic limit.")
  @NotNull


  public Boolean getTrafficLimitEnable() {
    return trafficLimitEnable;
  }

  public void setTrafficLimitEnable(Boolean trafficLimitEnable) {
    this.trafficLimitEnable = trafficLimitEnable;
  }

  public CreateLocalUserOpenApiVo trafficLimit(Long trafficLimit) {
    this.trafficLimit = trafficLimit;
    return this;
  }

  /**
   * Traffic limit in MB. It should be within the range of 1–10485760.
   * @return trafficLimit
  */
  @ApiModelProperty(value = "Traffic limit in MB. It should be within the range of 1–10485760.")


  public Long getTrafficLimit() {
    return trafficLimit;
  }

  public void setTrafficLimit(Long trafficLimit) {
    this.trafficLimit = trafficLimit;
  }

  public CreateLocalUserOpenApiVo trafficLimitFrequency(Integer trafficLimitFrequency) {
    this.trafficLimitFrequency = trafficLimitFrequency;
    return this;
  }

  /**
   * Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.
   * @return trafficLimitFrequency
  */
  @ApiModelProperty(value = "Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.")


  public Integer getTrafficLimitFrequency() {
    return trafficLimitFrequency;
  }

  public void setTrafficLimitFrequency(Integer trafficLimitFrequency) {
    this.trafficLimitFrequency = trafficLimitFrequency;
  }

  public CreateLocalUserOpenApiVo portals(List<String> portals) {
    this.portals = portals;
    return this;
  }

  public CreateLocalUserOpenApiVo addPortalsItem(String portalsItem) {
    this.portals.add(portalsItem);
    return this;
  }

  /**
   * Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface
   * @return portals
  */
  @ApiModelProperty(required = true, value = "Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface")
  @NotNull


  public List<String> getPortals() {
    return portals;
  }

  public void setPortals(List<String> portals) {
    this.portals = portals;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateLocalUserOpenApiVo createLocalUserOpenApiVo = (CreateLocalUserOpenApiVo) o;
    return Objects.equals(this.userName, createLocalUserOpenApiVo.userName) &&
        Objects.equals(this.password, createLocalUserOpenApiVo.password) &&
        Objects.equals(this.enable, createLocalUserOpenApiVo.enable) &&
        Objects.equals(this.expirationTime, createLocalUserOpenApiVo.expirationTime) &&
        Objects.equals(this.bindingType, createLocalUserOpenApiVo.bindingType) &&
        Objects.equals(this.macAddress, createLocalUserOpenApiVo.macAddress) &&
        Objects.equals(this.maxUsers, createLocalUserOpenApiVo.maxUsers) &&
        Objects.equals(this.name, createLocalUserOpenApiVo.name) &&
        Objects.equals(this.phone, createLocalUserOpenApiVo.phone) &&
        Objects.equals(this.rateLimit, createLocalUserOpenApiVo.rateLimit) &&
        Objects.equals(this.trafficLimitEnable, createLocalUserOpenApiVo.trafficLimitEnable) &&
        Objects.equals(this.trafficLimit, createLocalUserOpenApiVo.trafficLimit) &&
        Objects.equals(this.trafficLimitFrequency, createLocalUserOpenApiVo.trafficLimitFrequency) &&
        Objects.equals(this.portals, createLocalUserOpenApiVo.portals);
  }

  @Override
  public int hashCode() {
    return Objects.hash(userName, password, enable, expirationTime, bindingType, macAddress, maxUsers, name, phone, rateLimit, trafficLimitEnable, trafficLimit, trafficLimitFrequency, portals);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateLocalUserOpenApiVo {\n");
    
    sb.append("    userName: ").append(toIndentedString(userName)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    expirationTime: ").append(toIndentedString(expirationTime)).append("\n");
    sb.append("    bindingType: ").append(toIndentedString(bindingType)).append("\n");
    sb.append("    macAddress: ").append(toIndentedString(macAddress)).append("\n");
    sb.append("    maxUsers: ").append(toIndentedString(maxUsers)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    phone: ").append(toIndentedString(phone)).append("\n");
    sb.append("    rateLimit: ").append(toIndentedString(rateLimit)).append("\n");
    sb.append("    trafficLimitEnable: ").append(toIndentedString(trafficLimitEnable)).append("\n");
    sb.append("    trafficLimit: ").append(toIndentedString(trafficLimit)).append("\n");
    sb.append("    trafficLimitFrequency: ").append(toIndentedString(trafficLimitFrequency)).append("\n");
    sb.append("    portals: ").append(toIndentedString(portals)).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    ");
  }
}

