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;

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

public class SslVpnResourceModifyOpenApiVo   {
  @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 SslVpnResourceModifyOpenApiVo type(Integer type) {
    this.type = type;
    return this;
  }

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


  public Integer getType() {
    return type;
  }

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

  public SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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 SslVpnResourceModifyOpenApiVo 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;
    }
    SslVpnResourceModifyOpenApiVo sslVpnResourceModifyOpenApiVo = (SslVpnResourceModifyOpenApiVo) o;
    return Objects.equals(this.type, sslVpnResourceModifyOpenApiVo.type) &&
        Objects.equals(this.ip, sslVpnResourceModifyOpenApiVo.ip) &&
        Objects.equals(this.mask, sslVpnResourceModifyOpenApiVo.mask) &&
        Objects.equals(this.domain, sslVpnResourceModifyOpenApiVo.domain) &&
        Objects.equals(this.protocol, sslVpnResourceModifyOpenApiVo.protocol) &&
        Objects.equals(this.srcPortStart, sslVpnResourceModifyOpenApiVo.srcPortStart) &&
        Objects.equals(this.srcPortEnd, sslVpnResourceModifyOpenApiVo.srcPortEnd) &&
        Objects.equals(this.dstPortStart, sslVpnResourceModifyOpenApiVo.dstPortStart) &&
        Objects.equals(this.dstPortEnd, sslVpnResourceModifyOpenApiVo.dstPortEnd) &&
        Objects.equals(this.icmpType, sslVpnResourceModifyOpenApiVo.icmpType) &&
        Objects.equals(this.icmpCode, sslVpnResourceModifyOpenApiVo.icmpCode) &&
        Objects.equals(this.otherProtocol, sslVpnResourceModifyOpenApiVo.otherProtocol);
  }

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

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

