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

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

public class IpsInfo   {
  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("ipsMode")
  private Integer ipsMode;

  @JsonProperty("geoEnable")
  private Boolean geoEnable;

  @JsonProperty("dpLevel")
  private Integer dpLevel;

  @JsonProperty("customCategories")
  @Valid
  private List<Integer> customCategories = null;

  @JsonProperty("timeRangeId")
  private String timeRangeId;

  public IpsInfo enable(Boolean enable) {
    this.enable = enable;
    return this;
  }

  /**
   * Whether to enable IDS/IPS config. If parameter[enable] is true, parameter[ipsMode] and parameter[dplevel] are needed
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Whether to enable IDS/IPS config. If parameter[enable] is true, parameter[ipsMode] and parameter[dplevel] are needed")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

  public IpsInfo ipsMode(Integer ipsMode) {
    this.ipsMode = ipsMode;
    return this;
  }

  /**
   * IpsMode should be a value as follows: 0: detect only; 1: detect and block
   * @return ipsMode
  */
  @ApiModelProperty(value = "IpsMode should be a value as follows: 0: detect only; 1: detect and block")


  public Integer getIpsMode() {
    return ipsMode;
  }

  public void setIpsMode(Integer ipsMode) {
    this.ipsMode = ipsMode;
  }

  public IpsInfo geoEnable(Boolean geoEnable) {
    this.geoEnable = geoEnable;
    return this;
  }

  /**
   * Whether to enable identifying the source country and destination country of attack ip addresses.
   * @return geoEnable
  */
  @ApiModelProperty(value = "Whether to enable identifying the source country and destination country of attack ip addresses.")


  public Boolean getGeoEnable() {
    return geoEnable;
  }

  public void setGeoEnable(Boolean geoEnable) {
    this.geoEnable = geoEnable;
  }

  public IpsInfo dpLevel(Integer dpLevel) {
    this.dpLevel = dpLevel;
    return this;
  }

  /**
   * DpLevel should be a value as follows: 0: Low; 1: Medium; 2: High; 3: Custom
   * @return dpLevel
  */
  @ApiModelProperty(value = "DpLevel should be a value as follows: 0: Low; 1: Medium; 2: High; 3: Custom")


  public Integer getDpLevel() {
    return dpLevel;
  }

  public void setDpLevel(Integer dpLevel) {
    this.dpLevel = dpLevel;
  }

  public IpsInfo customCategories(List<Integer> customCategories) {
    this.customCategories = customCategories;
    return this;
  }

  public IpsInfo addCustomCategoriesItem(Integer customCategoriesItem) {
    if (this.customCategories == null) {
      this.customCategories = new ArrayList<>();
    }
    this.customCategories.add(customCategoriesItem);
    return this;
  }

  /**
   * Custom IDS/IPS categories list, if parameter[Dplevel] is 3, customCategories is needed.CustomCategories should be a list as follow: 1: Botcc, 2: Worm, 3: Malware, 4: Mobile_Malware, 6: P2P, 7: Tor, 8: Exploit, 9: Shellcode, 14: Activex, 15: DNS, 18: User Agents, 24: DShield
   * @return customCategories
  */
  @ApiModelProperty(value = "Custom IDS/IPS categories list, if parameter[Dplevel] is 3, customCategories is needed.CustomCategories should be a list as follow: 1: Botcc, 2: Worm, 3: Malware, 4: Mobile_Malware, 6: P2P, 7: Tor, 8: Exploit, 9: Shellcode, 14: Activex, 15: DNS, 18: User Agents, 24: DShield")


  public List<Integer> getCustomCategories() {
    return customCategories;
  }

  public void setCustomCategories(List<Integer> customCategories) {
    this.customCategories = customCategories;
  }

  public IpsInfo timeRangeId(String timeRangeId) {
    this.timeRangeId = timeRangeId;
    return this;
  }

  /**
   * This field represents Time Range ID. Time Range can be created using 'Create time range profile' interface, and Time Range ID can be obtained from 'Get time range profile list' interface. If parameter[timeRangeId] is null, IDS/IPS will be effective in all time ranges.
   * @return timeRangeId
  */
  @ApiModelProperty(value = "This field represents Time Range ID. Time Range can be created using 'Create time range profile' interface, and Time Range ID can be obtained from 'Get time range profile list' interface. If parameter[timeRangeId] is null, IDS/IPS will be effective in all time ranges.")


  public String getTimeRangeId() {
    return timeRangeId;
  }

  public void setTimeRangeId(String timeRangeId) {
    this.timeRangeId = timeRangeId;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IpsInfo ipsInfo = (IpsInfo) o;
    return Objects.equals(this.enable, ipsInfo.enable) &&
        Objects.equals(this.ipsMode, ipsInfo.ipsMode) &&
        Objects.equals(this.geoEnable, ipsInfo.geoEnable) &&
        Objects.equals(this.dpLevel, ipsInfo.dpLevel) &&
        Objects.equals(this.customCategories, ipsInfo.customCategories) &&
        Objects.equals(this.timeRangeId, ipsInfo.timeRangeId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, ipsMode, geoEnable, dpLevel, customCategories, timeRangeId);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class IpsInfo {\n");
    
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    ipsMode: ").append(toIndentedString(ipsMode)).append("\n");
    sb.append("    geoEnable: ").append(toIndentedString(geoEnable)).append("\n");
    sb.append("    dpLevel: ").append(toIndentedString(dpLevel)).append("\n");
    sb.append("    customCategories: ").append(toIndentedString(customCategories)).append("\n");
    sb.append("    timeRangeId: ").append(toIndentedString(timeRangeId)).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    ");
  }
}

