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 DhcpSettingInfo   {
  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("ipRangePool")
  @Valid
  private List<DhcpRangeOpenApiVo> ipRangePool = null;

  @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("options")
  @Valid
  private List<CustomDhcpOptions> options = null;

  public DhcpSettingInfo 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 DhcpSettingInfo ipRangePool(List<DhcpRangeOpenApiVo> ipRangePool) {
    this.ipRangePool = ipRangePool;
    return this;
  }

  public DhcpSettingInfo addIpRangePoolItem(DhcpRangeOpenApiVo ipRangePoolItem) {
    if (this.ipRangePool == null) {
      this.ipRangePool = new ArrayList<>();
    }
    this.ipRangePool.add(ipRangePoolItem);
    return this;
  }

  /**
   * The list of DHCP Range, which size can't be more than \"dhcpRangePoolSize\", \"dhcpRangePoolSize\" can be obtained from 'Get LAN network list' interface.
   * @return ipRangePool
  */
  @ApiModelProperty(value = "The list of DHCP Range, which size can't be more than \"dhcpRangePoolSize\", \"dhcpRangePoolSize\" can be obtained from 'Get LAN network list' interface.")

  @Valid

  public List<DhcpRangeOpenApiVo> getIpRangePool() {
    return ipRangePool;
  }

  public void setIpRangePool(List<DhcpRangeOpenApiVo> ipRangePool) {
    this.ipRangePool = ipRangePool;
  }

  public DhcpSettingInfo 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 DhcpSettingInfo 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 DhcpSettingInfo 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 DhcpSettingInfo 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 DhcpSettingInfo 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 DhcpSettingInfo leasetime(Integer leasetime) {
    this.leasetime = leasetime;
    return this;
  }

  /**
   * Leasetime should be within the range of 2-10080
   * @return leasetime
  */
  @ApiModelProperty(value = "Leasetime should be within the range of 2-10080")


  public Integer getLeasetime() {
    return leasetime;
  }

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

  public DhcpSettingInfo 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 DhcpSettingInfo options(List<CustomDhcpOptions> options) {
    this.options = options;
    return this;
  }

  public DhcpSettingInfo 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;
    }
    DhcpSettingInfo dhcpSettingInfo = (DhcpSettingInfo) o;
    return Objects.equals(this.enable, dhcpSettingInfo.enable) &&
        Objects.equals(this.ipRangePool, dhcpSettingInfo.ipRangePool) &&
        Objects.equals(this.ipRangeStart, dhcpSettingInfo.ipRangeStart) &&
        Objects.equals(this.ipRangeEnd, dhcpSettingInfo.ipRangeEnd) &&
        Objects.equals(this.dhcpns, dhcpSettingInfo.dhcpns) &&
        Objects.equals(this.priDns, dhcpSettingInfo.priDns) &&
        Objects.equals(this.sndDns, dhcpSettingInfo.sndDns) &&
        Objects.equals(this.leasetime, dhcpSettingInfo.leasetime) &&
        Objects.equals(this.gateway, dhcpSettingInfo.gateway) &&
        Objects.equals(this.options, dhcpSettingInfo.options);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, ipRangePool, ipRangeStart, ipRangeEnd, dhcpns, priDns, sndDns, leasetime, gateway, options);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class DhcpSettingInfo {\n");
    
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    ipRangePool: ").append(toIndentedString(ipRangePool)).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("    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    ");
  }
}

