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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
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;

/**
 * PPSK Profile Setting.
 */
@ApiModel(description = "PPSK Profile Setting.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class PpskProfileV2   {
  @JsonProperty("profileName")
  private String profileName;

  @JsonProperty("autoCreatePsks")
  private Boolean autoCreatePsks;

  @JsonProperty("ppsk")
  @Valid
  private List<PpskSettingV2> ppsk = null;

  @JsonProperty("number")
  private Integer number;

  @JsonProperty("prefix")
  private String prefix;

  @JsonProperty("length")
  private Integer length;

  @JsonProperty("vlan")
  private Integer vlan;

  public PpskProfileV2 profileName(String profileName) {
    this.profileName = profileName;
    return this;
  }

  /**
   * PPSK Profile Name, should contain 1 to 64 characters.
   * @return profileName
  */
  @ApiModelProperty(required = true, value = "PPSK Profile Name, should contain 1 to 64 characters.")
  @NotNull

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

  public void setProfileName(String profileName) {
    this.profileName = profileName;
  }

  public PpskProfileV2 autoCreatePsks(Boolean autoCreatePsks) {
    this.autoCreatePsks = autoCreatePsks;
    return this;
  }

  /**
   * Whether to enable auto create psks
   * @return autoCreatePsks
  */
  @ApiModelProperty(required = true, value = "Whether to enable auto create psks")
  @NotNull


  public Boolean getAutoCreatePsks() {
    return autoCreatePsks;
  }

  public void setAutoCreatePsks(Boolean autoCreatePsks) {
    this.autoCreatePsks = autoCreatePsks;
  }

  public PpskProfileV2 ppsk(List<PpskSettingV2> ppsk) {
    this.ppsk = ppsk;
    return this;
  }

  public PpskProfileV2 addPpskItem(PpskSettingV2 ppskItem) {
    if (this.ppsk == null) {
      this.ppsk = new ArrayList<>();
    }
    this.ppsk.add(ppskItem);
    return this;
  }

  /**
   * This field is required when Parameter [autoCreatePsks] is false; PPSK List In the PPSK Profile
   * @return ppsk
  */
  @ApiModelProperty(value = "This field is required when Parameter [autoCreatePsks] is false; PPSK List In the PPSK Profile")

  @Valid

  public List<PpskSettingV2> getPpsk() {
    return ppsk;
  }

  public void setPpsk(List<PpskSettingV2> ppsk) {
    this.ppsk = ppsk;
  }

  public PpskProfileV2 number(Integer number) {
    this.number = number;
    return this;
  }

  /**
   * This field is required when Parameter [autoCreatePsks] is true; Generate Number, should be within the range of 1-1024.
   * @return number
  */
  @ApiModelProperty(value = "This field is required when Parameter [autoCreatePsks] is true; Generate Number, should be within the range of 1-1024.")


  public Integer getNumber() {
    return number;
  }

  public void setNumber(Integer number) {
    this.number = number;
  }

  public PpskProfileV2 prefix(String prefix) {
    this.prefix = prefix;
    return this;
  }

  /**
   * This field is required when Parameter [autoCreatePsks] is true; PSK Name Prefix, should contain 1 to 60 visible ASCII characters.
   * @return prefix
  */
  @ApiModelProperty(value = "This field is required when Parameter [autoCreatePsks] is true; PSK Name Prefix, should contain 1 to 60 visible ASCII characters.")

@Pattern(regexp="^[a-zA-z0-9'!\"#$%&()*,./:;?^_`\\[\\]{|}~<>\\ ][\\041-\\0176]{0,59}$") 
  public String getPrefix() {
    return prefix;
  }

  public void setPrefix(String prefix) {
    this.prefix = prefix;
  }

  public PpskProfileV2 length(Integer length) {
    this.length = length;
    return this;
  }

  /**
   * This field is required when Parameter [autoCreatePsks] is true; PSK Password Length, should be within the range of 8-63.
   * @return length
  */
  @ApiModelProperty(value = "This field is required when Parameter [autoCreatePsks] is true; PSK Password Length, should be within the range of 8-63.")


  public Integer getLength() {
    return length;
  }

  public void setLength(Integer length) {
    this.length = length;
  }

  public PpskProfileV2 vlan(Integer vlan) {
    this.vlan = vlan;
    return this;
  }

  /**
   * This field is required when Parameter [autoCreatePsks] is true; PSK Bound Vlan, should be within the range of 1-4094.
   * @return vlan
  */
  @ApiModelProperty(value = "This field is required when Parameter [autoCreatePsks] is true; PSK Bound Vlan, should be within the range of 1-4094.")


  public Integer getVlan() {
    return vlan;
  }

  public void setVlan(Integer vlan) {
    this.vlan = vlan;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PpskProfileV2 ppskProfileV2 = (PpskProfileV2) o;
    return Objects.equals(this.profileName, ppskProfileV2.profileName) &&
        Objects.equals(this.autoCreatePsks, ppskProfileV2.autoCreatePsks) &&
        Objects.equals(this.ppsk, ppskProfileV2.ppsk) &&
        Objects.equals(this.number, ppskProfileV2.number) &&
        Objects.equals(this.prefix, ppskProfileV2.prefix) &&
        Objects.equals(this.length, ppskProfileV2.length) &&
        Objects.equals(this.vlan, ppskProfileV2.vlan);
  }

  @Override
  public int hashCode() {
    return Objects.hash(profileName, autoCreatePsks, ppsk, number, prefix, length, vlan);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PpskProfileV2 {\n");
    
    sb.append("    profileName: ").append(toIndentedString(profileName)).append("\n");
    sb.append("    autoCreatePsks: ").append(toIndentedString(autoCreatePsks)).append("\n");
    sb.append("    ppsk: ").append(toIndentedString(ppsk)).append("\n");
    sb.append("    number: ").append(toIndentedString(number)).append("\n");
    sb.append("    prefix: ").append(toIndentedString(prefix)).append("\n");
    sb.append("    length: ").append(toIndentedString(length)).append("\n");
    sb.append("    vlan: ").append(toIndentedString(vlan)).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    ");
  }
}

