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;

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

public class AddRuleEntity   {
  @JsonProperty("ruleName")
  private String ruleName;

  @JsonProperty("schedule")
  private String schedule;

  @JsonProperty("qos")
  private Boolean qos;

  @JsonProperty("qosClass")
  private Integer qosClass;

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

  @JsonProperty("selectType")
  private String selectType;

  public AddRuleEntity ruleName(String ruleName) {
    this.ruleName = ruleName;
    return this;
  }

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

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

  public void setRuleName(String ruleName) {
    this.ruleName = ruleName;
  }

  public AddRuleEntity schedule(String schedule) {
    this.schedule = schedule;
    return this;
  }

  /**
   * Schedule profile ID, which can be queried by request： Get time range profile list.
   * @return schedule
  */
  @ApiModelProperty(required = true, value = "Schedule profile ID, which can be queried by request： Get time range profile list.")
  @NotNull


  public String getSchedule() {
    return schedule;
  }

  public void setSchedule(String schedule) {
    this.schedule = schedule;
  }

  public AddRuleEntity qos(Boolean qos) {
    this.qos = qos;
    return this;
  }

  /**
   * Enable qos. true:enable / false:disable
   * @return qos
  */
  @ApiModelProperty(required = true, value = "Enable qos. true:enable / false:disable")
  @NotNull


  public Boolean getQos() {
    return qos;
  }

  public void setQos(Boolean qos) {
    this.qos = qos;
  }

  public AddRuleEntity qosClass(Integer qosClass) {
    this.qosClass = qosClass;
    return this;
  }

  /**
   * The Class value selected in the Qos Class configuration, required when qos is enable. Valid values is 0: Others, 1: Class 1, 2: Class 2, 3: Class 3.
   * @return qosClass
  */
  @ApiModelProperty(value = "The Class value selected in the Qos Class configuration, required when qos is enable. Valid values is 0: Others, 1: Class 1, 2: Class 2, 3: Class 3.")


  public Integer getQosClass() {
    return qosClass;
  }

  public void setQosClass(Integer qosClass) {
    this.qosClass = qosClass;
  }

  public AddRuleEntity applications(List<Integer> applications) {
    this.applications = applications;
    return this;
  }

  public AddRuleEntity addApplicationsItem(Integer applicationsItem) {
    this.applications.add(applicationsItem);
    return this;
  }

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


  public List<Integer> getApplications() {
    return applications;
  }

  public void setApplications(List<Integer> applications) {
    this.applications = applications;
  }

  public AddRuleEntity selectType(String selectType) {
    this.selectType = selectType;
    return this;
  }

  /**
   * Select type of applications. include: include selected applications, exclude: all but exclude selected applications, all: include all applications.
   * @return selectType
  */
  @ApiModelProperty(required = true, value = "Select type of applications. include: include selected applications, exclude: all but exclude selected applications, all: include all applications.")
  @NotNull


  public String getSelectType() {
    return selectType;
  }

  public void setSelectType(String selectType) {
    this.selectType = selectType;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    AddRuleEntity addRuleEntity = (AddRuleEntity) o;
    return Objects.equals(this.ruleName, addRuleEntity.ruleName) &&
        Objects.equals(this.schedule, addRuleEntity.schedule) &&
        Objects.equals(this.qos, addRuleEntity.qos) &&
        Objects.equals(this.qosClass, addRuleEntity.qosClass) &&
        Objects.equals(this.applications, addRuleEntity.applications) &&
        Objects.equals(this.selectType, addRuleEntity.selectType);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ruleName, schedule, qos, qosClass, applications, selectType);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class AddRuleEntity {\n");
    
    sb.append("    ruleName: ").append(toIndentedString(ruleName)).append("\n");
    sb.append("    schedule: ").append(toIndentedString(schedule)).append("\n");
    sb.append("    qos: ").append(toIndentedString(qos)).append("\n");
    sb.append("    qosClass: ").append(toIndentedString(qosClass)).append("\n");
    sb.append("    applications: ").append(toIndentedString(applications)).append("\n");
    sb.append("    selectType: ").append(toIndentedString(selectType)).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    ");
  }
}

