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;

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

public class VirtualWanIpv4DhcpOpenApiVo   {
  @JsonProperty("unicast")
  private String unicast;

  @JsonProperty("dns1")
  private String dns1;

  @JsonProperty("dns2")
  private String dns2;

  @JsonProperty("hostname")
  private String hostname;

  @JsonProperty("mtu")
  private Integer mtu;

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

  public VirtualWanIpv4DhcpOpenApiVo unicast(String unicast) {
    this.unicast = unicast;
    return this;
  }

  /**
   * Subnet mask of virtual WAN.
   * @return unicast
  */
  @ApiModelProperty(value = "Subnet mask of virtual WAN.")


  public String getUnicast() {
    return unicast;
  }

  public void setUnicast(String unicast) {
    this.unicast = unicast;
  }

  public VirtualWanIpv4DhcpOpenApiVo dns1(String dns1) {
    this.dns1 = dns1;
    return this;
  }

  /**
   * Primary DNS server.
   * @return dns1
  */
  @ApiModelProperty(value = "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 getDns1() {
    return dns1;
  }

  public void setDns1(String dns1) {
    this.dns1 = dns1;
  }

  public VirtualWanIpv4DhcpOpenApiVo dns2(String dns2) {
    this.dns2 = dns2;
    return this;
  }

  /**
   * Secondary DNS server.
   * @return dns2
  */
  @ApiModelProperty(value = "Secondary 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 getDns2() {
    return dns2;
  }

  public void setDns2(String dns2) {
    this.dns2 = dns2;
  }

  public VirtualWanIpv4DhcpOpenApiVo hostname(String hostname) {
    this.hostname = hostname;
    return this;
  }

  /**
   * Host name. Parameter [hostname] should be up to 63 characters long and can only use numbers, letters, and underscores.
   * @return hostname
  */
  @ApiModelProperty(value = "Host name. Parameter [hostname] should be up to 63 characters long and can only use numbers, letters, and underscores.")

@Pattern(regexp="^[a-zA-Z0-9_]{0,63}$") 
  public String getHostname() {
    return hostname;
  }

  public void setHostname(String hostname) {
    this.hostname = hostname;
  }

  public VirtualWanIpv4DhcpOpenApiVo mtu(Integer mtu) {
    this.mtu = mtu;
    return this;
  }

  /**
   * Parameter [mtu] should be a value between 576 and 1500.
   * @return mtu
  */
  @ApiModelProperty(value = "Parameter [mtu] should be a value between 576 and 1500.")


  public Integer getMtu() {
    return mtu;
  }

  public void setMtu(Integer mtu) {
    this.mtu = mtu;
  }

  public VirtualWanIpv4DhcpOpenApiVo dhcpOptions(List<CustomDhcpOptions> dhcpOptions) {
    this.dhcpOptions = dhcpOptions;
    return this;
  }

  public VirtualWanIpv4DhcpOpenApiVo addDhcpOptionsItem(CustomDhcpOptions dhcpOptionsItem) {
    if (this.dhcpOptions == null) {
      this.dhcpOptions = new ArrayList<>();
    }
    this.dhcpOptions.add(dhcpOptionsItem);
    return this;
  }

  /**
   * Virtual WAN custom DHCP options.
   * @return dhcpOptions
  */
  @ApiModelProperty(value = "Virtual WAN custom DHCP options.")

  @Valid

  public List<CustomDhcpOptions> getDhcpOptions() {
    return dhcpOptions;
  }

  public void setDhcpOptions(List<CustomDhcpOptions> dhcpOptions) {
    this.dhcpOptions = dhcpOptions;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VirtualWanIpv4DhcpOpenApiVo virtualWanIpv4DhcpOpenApiVo = (VirtualWanIpv4DhcpOpenApiVo) o;
    return Objects.equals(this.unicast, virtualWanIpv4DhcpOpenApiVo.unicast) &&
        Objects.equals(this.dns1, virtualWanIpv4DhcpOpenApiVo.dns1) &&
        Objects.equals(this.dns2, virtualWanIpv4DhcpOpenApiVo.dns2) &&
        Objects.equals(this.hostname, virtualWanIpv4DhcpOpenApiVo.hostname) &&
        Objects.equals(this.mtu, virtualWanIpv4DhcpOpenApiVo.mtu) &&
        Objects.equals(this.dhcpOptions, virtualWanIpv4DhcpOpenApiVo.dhcpOptions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(unicast, dns1, dns2, hostname, mtu, dhcpOptions);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VirtualWanIpv4DhcpOpenApiVo {\n");
    
    sb.append("    unicast: ").append(toIndentedString(unicast)).append("\n");
    sb.append("    dns1: ").append(toIndentedString(dns1)).append("\n");
    sb.append("    dns2: ").append(toIndentedString(dns2)).append("\n");
    sb.append("    hostname: ").append(toIndentedString(hostname)).append("\n");
    sb.append("    mtu: ").append(toIndentedString(mtu)).append("\n");
    sb.append("    dhcpOptions: ").append(toIndentedString(dhcpOptions)).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    ");
  }
}

