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.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class DhcpSettings   {
  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("ipaddrStart")
  private String ipaddrStart;

  @JsonProperty("ipaddrEnd")
  private String ipaddrEnd;

  @JsonProperty("ipRangeStart")
  private Long ipRangeStart;

  @JsonProperty("ipRangeEnd")
  private Long ipRangeEnd;

  @JsonProperty("dhcpns")
  private String dhcpns;

  @JsonProperty("priDns")
  private String priDns;

  @JsonProperty("sndDns")
  private String sndDns;

  @JsonProperty("leasetime")
  private Integer leasetime;

  @JsonProperty("gateway")
  private String gateway;

  @JsonProperty("hostIP")
  private String hostIP;

  @JsonProperty("option60")
  private String option60;

  @JsonProperty("option66")
  private String option66;

  @JsonProperty("option138")
  private String option138;

  @JsonProperty("options")
  @Valid
  private List<CustomDhcpOptions> options = null;

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

  /**
   * When value is true, DHCP server is enabled
   * @return enable
  */
  @ApiModelProperty(value = "When value is true, DHCP server is enabled")


  public Boolean getEnable() {
    return enable;
  }

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

  public DhcpSettings ipaddrStart(String ipaddrStart) {
    this.ipaddrStart = ipaddrStart;
    return this;
  }

  /**
   * DHCP Range Start IP. Must use ipRangePool field If want to configure multiple DHCP Ranges.
   * @return ipaddrStart
  */
  @ApiModelProperty(value = "DHCP Range Start IP. Must use ipRangePool field If want to configure multiple DHCP Ranges.")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getIpaddrStart() {
    return ipaddrStart;
  }

  public void setIpaddrStart(String ipaddrStart) {
    this.ipaddrStart = ipaddrStart;
  }

  public DhcpSettings ipaddrEnd(String ipaddrEnd) {
    this.ipaddrEnd = ipaddrEnd;
    return this;
  }

  /**
   * DHCP Range End IP. Must use ipRangePool field If want to configure multiple DHCP Ranges.
   * @return ipaddrEnd
  */
  @ApiModelProperty(value = "DHCP Range End IP. Must use ipRangePool field If want to configure multiple DHCP Ranges.")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getIpaddrEnd() {
    return ipaddrEnd;
  }

  public void setIpaddrEnd(String ipaddrEnd) {
    this.ipaddrEnd = ipaddrEnd;
  }

  public DhcpSettings ipRangeStart(Long ipRangeStart) {
    this.ipRangeStart = ipRangeStart;
    return this;
  }

  /**
   * The specific format value of Gateway Subnet start IP
   * @return ipRangeStart
  */
  @ApiModelProperty(value = "The specific format value of Gateway Subnet start IP")


  public Long getIpRangeStart() {
    return ipRangeStart;
  }

  public void setIpRangeStart(Long ipRangeStart) {
    this.ipRangeStart = ipRangeStart;
  }

  public DhcpSettings ipRangeEnd(Long ipRangeEnd) {
    this.ipRangeEnd = ipRangeEnd;
    return this;
  }

  /**
   * The specific format value of Gateway Subnet End IP
   * @return ipRangeEnd
  */
  @ApiModelProperty(value = "The specific format value of Gateway Subnet End IP")


  public Long getIpRangeEnd() {
    return ipRangeEnd;
  }

  public void setIpRangeEnd(Long ipRangeEnd) {
    this.ipRangeEnd = ipRangeEnd;
  }

  public DhcpSettings dhcpns(String dhcpns) {
    this.dhcpns = dhcpns;
    return this;
  }

  /**
   * Setup DHCP server: \"auto\" or \"manual\"
   * @return dhcpns
  */
  @ApiModelProperty(value = "Setup DHCP server: \"auto\" or \"manual\"")


  public String getDhcpns() {
    return dhcpns;
  }

  public void setDhcpns(String dhcpns) {
    this.dhcpns = dhcpns;
  }

  public DhcpSettings priDns(String priDns) {
    this.priDns = priDns;
    return this;
  }

  /**
   * When DHCPs are \"manual\", primary DNS Server.
   * @return priDns
  */
  @ApiModelProperty(value = "When DHCPs are \"manual\", primary DNS Server.")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getPriDns() {
    return priDns;
  }

  public void setPriDns(String priDns) {
    this.priDns = priDns;
  }

  public DhcpSettings sndDns(String sndDns) {
    this.sndDns = sndDns;
    return this;
  }

  /**
   * When DHCPs are \"manual\", second DNS Server.
   * @return sndDns
  */
  @ApiModelProperty(value = "When DHCPs are \"manual\", second DNS Server.")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getSndDns() {
    return sndDns;
  }

  public void setSndDns(String sndDns) {
    this.sndDns = sndDns;
  }

  public DhcpSettings leasetime(Integer leasetime) {
    this.leasetime = leasetime;
    return this;
  }

  /**
   * Valid value is from 2 to 2880
   * @return leasetime
  */
  @ApiModelProperty(value = "Valid value is from 2 to 2880")


  public Integer getLeasetime() {
    return leasetime;
  }

  public void setLeasetime(Integer leasetime) {
    this.leasetime = leasetime;
  }

  public DhcpSettings gateway(String gateway) {
    this.gateway = gateway;
    return this;
  }

  /**
   * Manual Setup of DHCP Gateway IP
   * @return gateway
  */
  @ApiModelProperty(value = "Manual Setup of DHCP Gateway IP")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getGateway() {
    return gateway;
  }

  public void setGateway(String gateway) {
    this.gateway = gateway;
  }

  public DhcpSettings hostIP(String hostIP) {
    this.hostIP = hostIP;
    return this;
  }

  /**
   * DHCP Omada Controller IP
   * @return hostIP
  */
  @ApiModelProperty(value = "DHCP Omada Controller IP")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getHostIP() {
    return hostIP;
  }

  public void setHostIP(String hostIP) {
    this.hostIP = hostIP;
  }

  public DhcpSettings option60(String option60) {
    this.option60 = option60;
    return this;
  }

  /**
   * Option60 should be between 0 and 50, which is used to optionally identify the vendor type and configuration of a DHCP client.
   * @return option60
  */
  @ApiModelProperty(value = "Option60 should be between 0 and 50, which is used to optionally identify the vendor type and configuration of a DHCP client.")

@Pattern(regexp="^[\\041-\\0176]{0,50}$") 
  public String getOption60() {
    return option60;
  }

  public void setOption60(String option60) {
    this.option60 = option60;
  }

  public DhcpSettings option66(String option66) {
    this.option66 = option66;
    return this;
  }

  /**
   * The Option66 should be between 0 and 128, which specifies the TFTP server information and supports a single TFTP server IP address.
   * @return option66
  */
  @ApiModelProperty(value = "The Option66 should be between 0 and 128, which specifies the TFTP server information and supports a single TFTP server IP address.")

@Pattern(regexp="^[\\041-\\0176]{0,128}$") 
  public String getOption66() {
    return option66;
  }

  public void setOption66(String option66) {
    this.option66 = option66;
  }

  public DhcpSettings option138(String option138) {
    this.option138 = option138;
    return this;
  }

  /**
   * The option138 should be valid IP address, which is used in discovering the devices by the Omada controller.
   * @return option138
  */
  @ApiModelProperty(value = "The option138 should be valid IP address, which is used in discovering the devices by the Omada controller.")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getOption138() {
    return option138;
  }

  public void setOption138(String option138) {
    this.option138 = option138;
  }

  public DhcpSettings options(List<CustomDhcpOptions> options) {
    this.options = options;
    return this;
  }

  public DhcpSettings addOptionsItem(CustomDhcpOptions optionsItem) {
    if (this.options == null) {
      this.options = new ArrayList<>();
    }
    this.options.add(optionsItem);
    return this;
  }

  /**
   * User custom DHCP options
   * @return options
  */
  @ApiModelProperty(value = "User custom DHCP options")

  @Valid

  public List<CustomDhcpOptions> getOptions() {
    return options;
  }

  public void setOptions(List<CustomDhcpOptions> options) {
    this.options = options;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DhcpSettings dhcpSettings = (DhcpSettings) o;
    return Objects.equals(this.enable, dhcpSettings.enable) &&
        Objects.equals(this.ipaddrStart, dhcpSettings.ipaddrStart) &&
        Objects.equals(this.ipaddrEnd, dhcpSettings.ipaddrEnd) &&
        Objects.equals(this.ipRangeStart, dhcpSettings.ipRangeStart) &&
        Objects.equals(this.ipRangeEnd, dhcpSettings.ipRangeEnd) &&
        Objects.equals(this.dhcpns, dhcpSettings.dhcpns) &&
        Objects.equals(this.priDns, dhcpSettings.priDns) &&
        Objects.equals(this.sndDns, dhcpSettings.sndDns) &&
        Objects.equals(this.leasetime, dhcpSettings.leasetime) &&
        Objects.equals(this.gateway, dhcpSettings.gateway) &&
        Objects.equals(this.hostIP, dhcpSettings.hostIP) &&
        Objects.equals(this.option60, dhcpSettings.option60) &&
        Objects.equals(this.option66, dhcpSettings.option66) &&
        Objects.equals(this.option138, dhcpSettings.option138) &&
        Objects.equals(this.options, dhcpSettings.options);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, ipaddrStart, ipaddrEnd, ipRangeStart, ipRangeEnd, dhcpns, priDns, sndDns, leasetime, gateway, hostIP, option60, option66, option138, options);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DhcpSettings {\n");
    
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    ipaddrStart: ").append(toIndentedString(ipaddrStart)).append("\n");
    sb.append("    ipaddrEnd: ").append(toIndentedString(ipaddrEnd)).append("\n");
    sb.append("    ipRangeStart: ").append(toIndentedString(ipRangeStart)).append("\n");
    sb.append("    ipRangeEnd: ").append(toIndentedString(ipRangeEnd)).append("\n");
    sb.append("    dhcpns: ").append(toIndentedString(dhcpns)).append("\n");
    sb.append("    priDns: ").append(toIndentedString(priDns)).append("\n");
    sb.append("    sndDns: ").append(toIndentedString(sndDns)).append("\n");
    sb.append("    leasetime: ").append(toIndentedString(leasetime)).append("\n");
    sb.append("    gateway: ").append(toIndentedString(gateway)).append("\n");
    sb.append("    hostIP: ").append(toIndentedString(hostIP)).append("\n");
    sb.append("    option60: ").append(toIndentedString(option60)).append("\n");
    sb.append("    option66: ").append(toIndentedString(option66)).append("\n");
    sb.append("    option138: ").append(toIndentedString(option138)).append("\n");
    sb.append("    options: ").append(toIndentedString(options)).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    ");
  }
}

