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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

/**
 * Client IP setting.
 */
@ApiModel(description = "Client IP setting.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T10:16:05.926+08:00[Asia/Shanghai]")

public class ClientIpSetting   {
  @JsonProperty("useFixedAddr")
  private Boolean useFixedAddr;

  @JsonProperty("netId")
  private String netId;

  @JsonProperty("ip")
  private String ip;

  public ClientIpSetting useFixedAddr(Boolean useFixedAddr) {
    this.useFixedAddr = useFixedAddr;
    return this;
  }

  /**
   * Whether to use the specified IP.
   * @return useFixedAddr
  */
  @ApiModelProperty(required = true, value = "Whether to use the specified IP.")
  @NotNull


  public Boolean getUseFixedAddr() {
    return useFixedAddr;
  }

  public void setUseFixedAddr(Boolean useFixedAddr) {
    this.useFixedAddr = useFixedAddr;
  }

  public ClientIpSetting netId(String netId) {
    this.netId = netId;
    return this;
  }

  /**
   * LAN network ID.
   * @return netId
  */
  @ApiModelProperty(value = "LAN network ID.")


  public String getNetId() {
    return netId;
  }

  public void setNetId(String netId) {
    this.netId = netId;
  }

  public ClientIpSetting ip(String ip) {
    this.ip = ip;
    return this;
  }

  /**
   * Client IP.
   * @return ip
  */
  @ApiModelProperty(value = "Client 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 getIp() {
    return ip;
  }

  public void setIp(String ip) {
    this.ip = ip;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientIpSetting clientIpSetting = (ClientIpSetting) o;
    return Objects.equals(this.useFixedAddr, clientIpSetting.useFixedAddr) &&
        Objects.equals(this.netId, clientIpSetting.netId) &&
        Objects.equals(this.ip, clientIpSetting.ip);
  }

  @Override
  public int hashCode() {
    return Objects.hash(useFixedAddr, netId, ip);
  }

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

