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

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

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

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

public class SslVpnResourceConfigOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("type")
  private Integer type;

  @JsonProperty("ip")
  private String ip;

  @JsonProperty("mask")
  private String mask;

  @JsonProperty("domain")
  private String domain;

  @JsonProperty("protocol")
  private Integer protocol;

  @JsonProperty("srcPortStart")
  private Integer srcPortStart;

  @JsonProperty("srcPortEnd")
  private Integer srcPortEnd;

  @JsonProperty("dstPortStart")
  private Integer dstPortStart;

  @JsonProperty("dstPortEnd")
  private Integer dstPortEnd;

  @JsonProperty("icmpType")
  private Integer icmpType;

  @JsonProperty("icmpCode")
  private Integer icmpCode;

  @JsonProperty("otherProtocol")
  private Integer otherProtocol;

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

  /**
   * Name of the SSL VPN resource should contain 1 to 20 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name of the SSL VPN resource should contain 1 to 20 characters.")
  @NotNull

@Pattern(regexp="^[\\041-\\0176]$|^[\\041-\\0176][\\040-\\0176]{0,18}[\\041-\\0176]$") 
  public String getName() {
    return name;
  }

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

  public SslVpnResourceConfigOpenApiVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * Type of the SSL VPN resource should be a value as follows: 0: IP; 1: domain.
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type of the SSL VPN resource should be a value as follows: 0: IP; 1: domain.")
  @NotNull


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

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

  /**
   * IP of the SSL VPN resource, exists when type is 0.
   * @return ip
  */
  @ApiModelProperty(value = "IP of the SSL VPN resource, exists when type is 0.")

@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;
  }

  public SslVpnResourceConfigOpenApiVo mask(String mask) {
    this.mask = mask;
    return this;
  }

  /**
   * Mask of the SSL VPN resource, exists when type is 0.
   * @return mask
  */
  @ApiModelProperty(value = "Mask of the SSL VPN resource, exists when type is 0.")


  public String getMask() {
    return mask;
  }

  public void setMask(String mask) {
    this.mask = mask;
  }

  public SslVpnResourceConfigOpenApiVo domain(String domain) {
    this.domain = domain;
    return this;
  }

  /**
   * Domain of the SSL VPN resource, exists when type is 1.
   * @return domain
  */
  @ApiModelProperty(value = "Domain of the SSL VPN resource, exists when type is 1.")


  public String getDomain() {
    return domain;
  }

  public void setDomain(String domain) {
    this.domain = domain;
  }

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

  /**
   * Protocol of the SSL VPN resource should be a value as follows: 0:All; 1:TCP; 2:UDP; 3:TCP/UDP; 4:ICMP; 5:Other
   * @return protocol
  */
  @ApiModelProperty(value = "Protocol of the SSL VPN resource should be a value as follows: 0:All; 1:TCP; 2:UDP; 3:TCP/UDP; 4:ICMP; 5:Other")


  public Integer getProtocol() {
    return protocol;
  }

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

  public SslVpnResourceConfigOpenApiVo srcPortStart(Integer srcPortStart) {
    this.srcPortStart = srcPortStart;
    return this;
  }

  /**
   * Start source port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535
   * @return srcPortStart
  */
  @ApiModelProperty(value = "Start source port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535")


  public Integer getSrcPortStart() {
    return srcPortStart;
  }

  public void setSrcPortStart(Integer srcPortStart) {
    this.srcPortStart = srcPortStart;
  }

  public SslVpnResourceConfigOpenApiVo srcPortEnd(Integer srcPortEnd) {
    this.srcPortEnd = srcPortEnd;
    return this;
  }

  /**
   * End source port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535
   * @return srcPortEnd
  */
  @ApiModelProperty(value = "End source port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535")


  public Integer getSrcPortEnd() {
    return srcPortEnd;
  }

  public void setSrcPortEnd(Integer srcPortEnd) {
    this.srcPortEnd = srcPortEnd;
  }

  public SslVpnResourceConfigOpenApiVo dstPortStart(Integer dstPortStart) {
    this.dstPortStart = dstPortStart;
    return this;
  }

  /**
   * Start destination port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535
   * @return dstPortStart
  */
  @ApiModelProperty(value = "Start destination port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535")


  public Integer getDstPortStart() {
    return dstPortStart;
  }

  public void setDstPortStart(Integer dstPortStart) {
    this.dstPortStart = dstPortStart;
  }

  public SslVpnResourceConfigOpenApiVo dstPortEnd(Integer dstPortEnd) {
    this.dstPortEnd = dstPortEnd;
    return this;
  }

  /**
   * End destination port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535
   * @return dstPortEnd
  */
  @ApiModelProperty(value = "End destination port of the SSL VPN resource, exists when protocol is TCP or UDP. It should be within the range of 0–65535")


  public Integer getDstPortEnd() {
    return dstPortEnd;
  }

  public void setDstPortEnd(Integer dstPortEnd) {
    this.dstPortEnd = dstPortEnd;
  }

  public SslVpnResourceConfigOpenApiVo icmpType(Integer icmpType) {
    this.icmpType = icmpType;
    return this;
  }

  /**
   * ICMP type of the SSL VPN resource, exists when protocol is ICMP. It should be within the range of 0–255
   * @return icmpType
  */
  @ApiModelProperty(value = "ICMP type of the SSL VPN resource, exists when protocol is ICMP. It should be within the range of 0–255")


  public Integer getIcmpType() {
    return icmpType;
  }

  public void setIcmpType(Integer icmpType) {
    this.icmpType = icmpType;
  }

  public SslVpnResourceConfigOpenApiVo icmpCode(Integer icmpCode) {
    this.icmpCode = icmpCode;
    return this;
  }

  /**
   * ICMP code of the SSL VPN resource, exists when protocol is ICMP. It should be within the range of 0–255
   * @return icmpCode
  */
  @ApiModelProperty(value = "ICMP code of the SSL VPN resource, exists when protocol is ICMP. It should be within the range of 0–255")


  public Integer getIcmpCode() {
    return icmpCode;
  }

  public void setIcmpCode(Integer icmpCode) {
    this.icmpCode = icmpCode;
  }

  public SslVpnResourceConfigOpenApiVo otherProtocol(Integer otherProtocol) {
    this.otherProtocol = otherProtocol;
    return this;
  }

  /**
   * Other protocol of the SSL VPN resource. It should be within the range of 1–255.
   * @return otherProtocol
  */
  @ApiModelProperty(value = "Other protocol of the SSL VPN resource. It should be within the range of 1–255.")


  public Integer getOtherProtocol() {
    return otherProtocol;
  }

  public void setOtherProtocol(Integer otherProtocol) {
    this.otherProtocol = otherProtocol;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SslVpnResourceConfigOpenApiVo sslVpnResourceConfigOpenApiVo = (SslVpnResourceConfigOpenApiVo) o;
    return Objects.equals(this.name, sslVpnResourceConfigOpenApiVo.name) &&
        Objects.equals(this.type, sslVpnResourceConfigOpenApiVo.type) &&
        Objects.equals(this.ip, sslVpnResourceConfigOpenApiVo.ip) &&
        Objects.equals(this.mask, sslVpnResourceConfigOpenApiVo.mask) &&
        Objects.equals(this.domain, sslVpnResourceConfigOpenApiVo.domain) &&
        Objects.equals(this.protocol, sslVpnResourceConfigOpenApiVo.protocol) &&
        Objects.equals(this.srcPortStart, sslVpnResourceConfigOpenApiVo.srcPortStart) &&
        Objects.equals(this.srcPortEnd, sslVpnResourceConfigOpenApiVo.srcPortEnd) &&
        Objects.equals(this.dstPortStart, sslVpnResourceConfigOpenApiVo.dstPortStart) &&
        Objects.equals(this.dstPortEnd, sslVpnResourceConfigOpenApiVo.dstPortEnd) &&
        Objects.equals(this.icmpType, sslVpnResourceConfigOpenApiVo.icmpType) &&
        Objects.equals(this.icmpCode, sslVpnResourceConfigOpenApiVo.icmpCode) &&
        Objects.equals(this.otherProtocol, sslVpnResourceConfigOpenApiVo.otherProtocol);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, type, ip, mask, domain, protocol, srcPortStart, srcPortEnd, dstPortStart, dstPortEnd, icmpType, icmpCode, otherProtocol);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SslVpnResourceConfigOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    ip: ").append(toIndentedString(ip)).append("\n");
    sb.append("    mask: ").append(toIndentedString(mask)).append("\n");
    sb.append("    domain: ").append(toIndentedString(domain)).append("\n");
    sb.append("    protocol: ").append(toIndentedString(protocol)).append("\n");
    sb.append("    srcPortStart: ").append(toIndentedString(srcPortStart)).append("\n");
    sb.append("    srcPortEnd: ").append(toIndentedString(srcPortEnd)).append("\n");
    sb.append("    dstPortStart: ").append(toIndentedString(dstPortStart)).append("\n");
    sb.append("    dstPortEnd: ").append(toIndentedString(dstPortEnd)).append("\n");
    sb.append("    icmpType: ").append(toIndentedString(icmpType)).append("\n");
    sb.append("    icmpCode: ").append(toIndentedString(icmpCode)).append("\n");
    sb.append("    otherProtocol: ").append(toIndentedString(otherProtocol)).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    ");
  }
}

