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

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

public class PortIpOpenApiVo   {
  @JsonProperty("wanId")
  private String wanId;

  @JsonProperty("ip")
  private String ip;

  public PortIpOpenApiVo wanId(String wanId) {
    this.wanId = wanId;
    return this;
  }

  /**
   * This field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.
   * @return wanId
  */
  @ApiModelProperty(value = "This field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.")


  public String getWanId() {
    return wanId;
  }

  public void setWanId(String wanId) {
    this.wanId = wanId;
  }

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

  /**
   * IP address
   * @return ip
  */
  @ApiModelProperty(value = "IP address")

@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;
    }
    PortIpOpenApiVo portIpOpenApiVo = (PortIpOpenApiVo) o;
    return Objects.equals(this.wanId, portIpOpenApiVo.wanId) &&
        Objects.equals(this.ip, portIpOpenApiVo.ip);
  }

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

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

