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

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

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class PortForwardingInfo   {
  @JsonProperty("id")
  private String id;

  @JsonProperty("site id")
  private String siteId;

  @JsonProperty("name")
  private String name;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("from")
  private Integer from;

  @JsonProperty("limitedAddresses")
  @Valid
  private List<String> limitedAddresses = null;

  @JsonProperty("interfaceWanPortId")
  @Valid
  private List<String> interfaceWanPortId = new ArrayList<>();

  @JsonProperty("wanIps")
  @Valid
  private List<PortIpOpenApiVo> wanIps = null;

  @JsonProperty("externalPort")
  private String externalPort;

  @JsonProperty("forwardIp")
  private String forwardIp;

  @JsonProperty("forwardPort")
  private String forwardPort;

  @JsonProperty("protocol")
  private Integer protocol;

  @JsonProperty("dMZ")
  private Boolean dMZ;

  public PortForwardingInfo id(String id) {
    this.id = id;
    return this;
  }

  /**
   * Port-forwarding ID
   * @return id
  */
  @ApiModelProperty(value = "Port-forwarding ID")


  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public PortForwardingInfo siteId(String siteId) {
    this.siteId = siteId;
    return this;
  }

  /**
   * Site ID
   * @return siteId
  */
  @ApiModelProperty(value = "Site ID")


  public String getSiteId() {
    return siteId;
  }

  public void setSiteId(String siteId) {
    this.siteId = siteId;
  }

  public PortForwardingInfo name(String name) {
    this.name = name;
    return this;
  }

  /**
   * Name, name should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name, name should contain 1 to 64 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,62}[^ ]$") 
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public PortForwardingInfo status(Boolean status) {
    this.status = status;
    return this;
  }

  /**
   * Port-forwarding enable status.
   * @return status
  */
  @ApiModelProperty(required = true, value = "Port-forwarding enable status.")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

  public void setStatus(Boolean status) {
    this.status = status;
  }

  public PortForwardingInfo from(Integer from) {
    this.from = from;
    return this;
  }

  /**
   * From corresponds with source IP in web. From should be a value as follows: 0: where; 1: limited address
   * @return from
  */
  @ApiModelProperty(required = true, value = "From corresponds with source IP in web. From should be a value as follows: 0: where; 1: limited address")
  @NotNull


  public Integer getFrom() {
    return from;
  }

  public void setFrom(Integer from) {
    this.from = from;
  }

  public PortForwardingInfo limitedAddresses(List<String> limitedAddresses) {
    this.limitedAddresses = limitedAddresses;
    return this;
  }

  public PortForwardingInfo addLimitedAddressesItem(String limitedAddressesItem) {
    if (this.limitedAddresses == null) {
      this.limitedAddresses = new ArrayList<>();
    }
    this.limitedAddresses.add(limitedAddressesItem);
    return this;
  }

  /**
   * Only for limited address
   * @return limitedAddresses
  */
  @ApiModelProperty(value = "Only for limited address")


  public List<String> getLimitedAddresses() {
    return limitedAddresses;
  }

  public void setLimitedAddresses(List<String> limitedAddresses) {
    this.limitedAddresses = limitedAddresses;
  }

  public PortForwardingInfo interfaceWanPortId(List<String> interfaceWanPortId) {
    this.interfaceWanPortId = interfaceWanPortId;
    return this;
  }

  public PortForwardingInfo addInterfaceWanPortIdItem(String interfaceWanPortIdItem) {
    this.interfaceWanPortId.add(interfaceWanPortIdItem);
    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 interfaceWanPortId
  */
  @ApiModelProperty(required = true, value = "This field represents WAN port ID. WAN port ID can be obtained from can be obtained from 'Get internet basic info' interface.")
  @NotNull


  public List<String> getInterfaceWanPortId() {
    return interfaceWanPortId;
  }

  public void setInterfaceWanPortId(List<String> interfaceWanPortId) {
    this.interfaceWanPortId = interfaceWanPortId;
  }

  public PortForwardingInfo wanIps(List<PortIpOpenApiVo> wanIps) {
    this.wanIps = wanIps;
    return this;
  }

  public PortForwardingInfo addWanIpsItem(PortIpOpenApiVo wanIpsItem) {
    if (this.wanIps == null) {
      this.wanIps = new ArrayList<>();
    }
    this.wanIps.add(wanIpsItem);
    return this;
  }

  /**
   * WAN IPs
   * @return wanIps
  */
  @ApiModelProperty(value = "WAN IPs")

  @Valid

  public List<PortIpOpenApiVo> getWanIps() {
    return wanIps;
  }

  public void setWanIps(List<PortIpOpenApiVo> wanIps) {
    this.wanIps = wanIps;
  }

  public PortForwardingInfo externalPort(String externalPort) {
    this.externalPort = externalPort;
    return this;
  }

  /**
   * External port corresponds with source port in web. ExternalPort should be within the range of 1–65535.
   * @return externalPort
  */
  @ApiModelProperty(value = "External port corresponds with source port in web. ExternalPort should be within the range of 1–65535.")

@Pattern(regexp="^(([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5]))|((([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5]))-(([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5])))$") 
  public String getExternalPort() {
    return externalPort;
  }

  public void setExternalPort(String externalPort) {
    this.externalPort = externalPort;
  }

  public PortForwardingInfo forwardIp(String forwardIp) {
    this.forwardIp = forwardIp;
    return this;
  }

  /**
   * Forward IP corresponds with destination IP in web. Forward IP
   * @return forwardIp
  */
  @ApiModelProperty(required = true, value = "Forward IP corresponds with destination IP in web. Forward IP")
  @NotNull

@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 getForwardIp() {
    return forwardIp;
  }

  public void setForwardIp(String forwardIp) {
    this.forwardIp = forwardIp;
  }

  public PortForwardingInfo forwardPort(String forwardPort) {
    this.forwardPort = forwardPort;
    return this;
  }

  /**
   * Forward port corresponds with destination port in web. ForwardPort should be 1 or 1-10, within the range of 1–65535.
   * @return forwardPort
  */
  @ApiModelProperty(value = "Forward port corresponds with destination port in web. ForwardPort should be 1 or 1-10, within the range of 1–65535.")

@Pattern(regexp="^(([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5]))|((([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5]))-(([1-9]\\d{0,3})|([1-5]\\d{4})|(6[0-4]\\d{3})|(65[0-4]\\d{2})|(655[0-2]\\d)|(6553[0-5])))$") 
  public String getForwardPort() {
    return forwardPort;
  }

  public void setForwardPort(String forwardPort) {
    this.forwardPort = forwardPort;
  }

  public PortForwardingInfo protocol(Integer protocol) {
    this.protocol = protocol;
    return this;
  }

  /**
   * Protocol should be a value as follows: 0: ALL; 1: TCP; 2: UDP.
   * @return protocol
  */
  @ApiModelProperty(value = "Protocol should be a value as follows: 0: ALL; 1: TCP; 2: UDP.")


  public Integer getProtocol() {
    return protocol;
  }

  public void setProtocol(Integer protocol) {
    this.protocol = protocol;
  }

  public PortForwardingInfo dMZ(Boolean dMZ) {
    this.dMZ = dMZ;
    return this;
  }

  /**
   * With DMZ enabled, all ports are open and the traffic from external network will be forwarded to the specific destination IP in the LAN.
   * @return dMZ
  */
  @ApiModelProperty(required = true, value = "With DMZ enabled, all ports are open and the traffic from external network will be forwarded to the specific destination IP in the LAN.")
  @NotNull


  public Boolean getdMZ() {
    return dMZ;
  }

  public void setdMZ(Boolean dMZ) {
    this.dMZ = dMZ;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PortForwardingInfo portForwardingInfo = (PortForwardingInfo) o;
    return Objects.equals(this.id, portForwardingInfo.id) &&
        Objects.equals(this.siteId, portForwardingInfo.siteId) &&
        Objects.equals(this.name, portForwardingInfo.name) &&
        Objects.equals(this.status, portForwardingInfo.status) &&
        Objects.equals(this.from, portForwardingInfo.from) &&
        Objects.equals(this.limitedAddresses, portForwardingInfo.limitedAddresses) &&
        Objects.equals(this.interfaceWanPortId, portForwardingInfo.interfaceWanPortId) &&
        Objects.equals(this.wanIps, portForwardingInfo.wanIps) &&
        Objects.equals(this.externalPort, portForwardingInfo.externalPort) &&
        Objects.equals(this.forwardIp, portForwardingInfo.forwardIp) &&
        Objects.equals(this.forwardPort, portForwardingInfo.forwardPort) &&
        Objects.equals(this.protocol, portForwardingInfo.protocol) &&
        Objects.equals(this.dMZ, portForwardingInfo.dMZ);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, siteId, name, status, from, limitedAddresses, interfaceWanPortId, wanIps, externalPort, forwardIp, forwardPort, protocol, dMZ);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PortForwardingInfo {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    siteId: ").append(toIndentedString(siteId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    from: ").append(toIndentedString(from)).append("\n");
    sb.append("    limitedAddresses: ").append(toIndentedString(limitedAddresses)).append("\n");
    sb.append("    interfaceWanPortId: ").append(toIndentedString(interfaceWanPortId)).append("\n");
    sb.append("    wanIps: ").append(toIndentedString(wanIps)).append("\n");
    sb.append("    externalPort: ").append(toIndentedString(externalPort)).append("\n");
    sb.append("    forwardIp: ").append(toIndentedString(forwardIp)).append("\n");
    sb.append("    forwardPort: ").append(toIndentedString(forwardPort)).append("\n");
    sb.append("    protocol: ").append(toIndentedString(protocol)).append("\n");
    sb.append("    dMZ: ").append(toIndentedString(dMZ)).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    ");
  }
}

