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;

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

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

  @JsonProperty("resourceGroupList")
  @Valid
  private List<SslVpnResourceGroupBriefInfo> resourceGroupList = null;

  @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 SslVpnResourceEntity id(String id) {
    this.id = id;
    return this;
  }

  /**
   * ID of the SSL VPN resource.
   * @return id
  */
  @ApiModelProperty(value = "ID of the SSL VPN resource.")


  public String getId() {
    return id;
  }

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

  public SslVpnResourceEntity resourceGroupList(List<SslVpnResourceGroupBriefInfo> resourceGroupList) {
    this.resourceGroupList = resourceGroupList;
    return this;
  }

  public SslVpnResourceEntity addResourceGroupListItem(SslVpnResourceGroupBriefInfo resourceGroupListItem) {
    if (this.resourceGroupList == null) {
      this.resourceGroupList = new ArrayList<>();
    }
    this.resourceGroupList.add(resourceGroupListItem);
    return this;
  }

  /**
   * Resource group list of the SSL VPN resource.
   * @return resourceGroupList
  */
  @ApiModelProperty(value = "Resource group list of the SSL VPN resource.")

  @Valid

  public List<SslVpnResourceGroupBriefInfo> getResourceGroupList() {
    return resourceGroupList;
  }

  public void setResourceGroupList(List<SslVpnResourceGroupBriefInfo> resourceGroupList) {
    this.resourceGroupList = resourceGroupList;
  }

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

  /**
   * Name of the SSL VPN resource.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name of the SSL VPN resource.")
  @NotNull


  public String getName() {
    return name;
  }

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

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

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

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

