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

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

public class IpsSignatureConfig   {
  @JsonProperty("type")
  private Integer type;

  @JsonProperty("direction")
  private Integer direction;

  @JsonProperty("trafficType")
  private Integer trafficType;

  @JsonProperty("ip")
  private String ip;

  @JsonProperty("subnet")
  private String subnet;

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

  /**
   * Type should be a value as follow: 0: all traffic; 1: packet tracking
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type should be a value as follow: 0: all traffic; 1: packet tracking")
  @NotNull


  public Integer getType() {
    return type;
  }

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

  public IpsSignatureConfig direction(Integer direction) {
    this.direction = direction;
    return this;
  }

  /**
   * Direction should be a value as follow: 0: both direction; 1: source direction; 2: destination direction
   * @return direction
  */
  @ApiModelProperty(value = "Direction should be a value as follow: 0: both direction; 1: source direction; 2: destination direction")


  public Integer getDirection() {
    return direction;
  }

  public void setDirection(Integer direction) {
    this.direction = direction;
  }

  public IpsSignatureConfig trafficType(Integer trafficType) {
    this.trafficType = trafficType;
    return this;
  }

  /**
   * TrafficType should be a value as follow: 0: ip address; 1: subnet
   * @return trafficType
  */
  @ApiModelProperty(value = "TrafficType should be a value as follow: 0: ip address; 1: subnet")


  public Integer getTrafficType() {
    return trafficType;
  }

  public void setTrafficType(Integer trafficType) {
    this.trafficType = trafficType;
  }

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

  /**
   * IPS signature traffic Source. If parameter [trafficType] is 0, parameter [ip] is needed
   * @return ip
  */
  @ApiModelProperty(value = "IPS signature traffic Source. If parameter [trafficType] is 0, parameter [ip] is needed")

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

  /**
   * IPS signature traffic Source. If parameter [trafficType] is 1, parameter [subnet] is needed
   * @return subnet
  */
  @ApiModelProperty(value = "IPS signature traffic Source. If parameter [trafficType] is 1, parameter [subnet] is needed")

@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])/([1-9]|((1|2)\\d)|(30|31|32))\\b") 
  public String getSubnet() {
    return subnet;
  }

  public void setSubnet(String subnet) {
    this.subnet = subnet;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IpsSignatureConfig ipsSignatureConfig = (IpsSignatureConfig) o;
    return Objects.equals(this.type, ipsSignatureConfig.type) &&
        Objects.equals(this.direction, ipsSignatureConfig.direction) &&
        Objects.equals(this.trafficType, ipsSignatureConfig.trafficType) &&
        Objects.equals(this.ip, ipsSignatureConfig.ip) &&
        Objects.equals(this.subnet, ipsSignatureConfig.subnet);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, direction, trafficType, ip, subnet);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class IpsSignatureConfig {\n");
    
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    direction: ").append(toIndentedString(direction)).append("\n");
    sb.append("    trafficType: ").append(toIndentedString(trafficType)).append("\n");
    sb.append("    ip: ").append(toIndentedString(ip)).append("\n");
    sb.append("    subnet: ").append(toIndentedString(subnet)).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    ");
  }
}

