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;

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

public class AddFilterEntity   {
  @JsonProperty("filterName")
  private String filterName;

  @JsonProperty("description")
  private String description;

  @JsonProperty("rules")
  @Valid
  private List<Integer> rules = new ArrayList<>();

  public AddFilterEntity filterName(String filterName) {
    this.filterName = filterName;
    return this;
  }

  /**
   * Filter name. It should be 1 - 128 characters
   * @return filterName
  */
  @ApiModelProperty(required = true, value = "Filter name. It should be 1 - 128 characters")
  @NotNull

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

  public void setFilterName(String filterName) {
    this.filterName = filterName;
  }

  public AddFilterEntity description(String description) {
    this.description = description;
    return this;
  }

  /**
   * Description of filter. It should be 1 - 128 characters
   * @return description
  */
  @ApiModelProperty(required = true, value = "Description of filter. It should be 1 - 128 characters")
  @NotNull

@Pattern(regexp="^.{1,128}$") 
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public AddFilterEntity rules(List<Integer> rules) {
    this.rules = rules;
    return this;
  }

  public AddFilterEntity addRulesItem(Integer rulesItem) {
    this.rules.add(rulesItem);
    return this;
  }

  /**
   * Rule ID list can be obtained from 'Get rule list' interface.
   * @return rules
  */
  @ApiModelProperty(required = true, value = "Rule ID list can be obtained from 'Get rule list' interface.")
  @NotNull


  public List<Integer> getRules() {
    return rules;
  }

  public void setRules(List<Integer> rules) {
    this.rules = rules;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AddFilterEntity addFilterEntity = (AddFilterEntity) o;
    return Objects.equals(this.filterName, addFilterEntity.filterName) &&
        Objects.equals(this.description, addFilterEntity.description) &&
        Objects.equals(this.rules, addFilterEntity.rules);
  }

  @Override
  public int hashCode() {
    return Objects.hash(filterName, description, rules);
  }

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

