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.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

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

public class UrlFilteringOpenApiVo   {
  @JsonProperty("type")
  private String type;

  @JsonProperty("name")
  private String name;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("policy")
  private Integer policy;

  @JsonProperty("sourceType")
  private Integer sourceType;

  @JsonProperty("sourceIds")
  @Valid
  private List<String> sourceIds = new ArrayList<>();

  @JsonProperty("mode")
  private Integer mode;

  @JsonProperty("urls")
  @Valid
  private List<String> urls = null;

  @JsonProperty("keywords")
  @Valid
  private List<String> keywords = null;

  @JsonProperty("filterMode")
  private Integer filterMode;

  @JsonProperty("scenarioMode")
  private Integer scenarioMode;

  @JsonProperty("categories")
  @Valid
  private Map<String, List<String>> categories = null;

  @JsonProperty("timeRange")
  private String timeRange;

  public UrlFilteringOpenApiVo type(String type) {
    this.type = type;
    return this;
  }

  /**
   * Type should be a value as follows: \"gateway\"; \"ap\".
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type should be a value as follows: \"gateway\"; \"ap\".")
  @NotNull

@Pattern(regexp="gateway|ap") 
  public String getType() {
    return type;
  }

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

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

  /**
   * Name should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name should contain 1 to 64 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,62}[^ ]$") 
  public String getName() {
    return name;
  }

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

  public UrlFilteringOpenApiVo status(Boolean status) {
    this.status = status;
    return this;
  }

  /**
   * Status of the URL filtering.
   * @return status
  */
  @ApiModelProperty(required = true, value = "Status of the URL filtering.")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

  public void setStatus(Boolean status) {
    this.status = status;
  }

  public UrlFilteringOpenApiVo policy(Integer policy) {
    this.policy = policy;
    return this;
  }

  /**
   * Policy should be a value as follows: 0: drop; 1: allow.
   * @return policy
  */
  @ApiModelProperty(required = true, value = "Policy should be a value as follows: 0: drop; 1: allow.")
  @NotNull


  public Integer getPolicy() {
    return policy;
  }

  public void setPolicy(Integer policy) {
    this.policy = policy;
  }

  public UrlFilteringOpenApiVo sourceType(Integer sourceType) {
    this.sourceType = sourceType;
    return this;
  }

  /**
   * Source type should be a value as follows: 0: network; 1: IP group; 2: SSID.
   * @return sourceType
  */
  @ApiModelProperty(required = true, value = "Source type should be a value as follows: 0: network; 1: IP group; 2: SSID.")
  @NotNull


  public Integer getSourceType() {
    return sourceType;
  }

  public void setSourceType(Integer sourceType) {
    this.sourceType = sourceType;
  }

  public UrlFilteringOpenApiVo sourceIds(List<String> sourceIds) {
    this.sourceIds = sourceIds;
    return this;
  }

  public UrlFilteringOpenApiVo addSourceIdsItem(String sourceIdsItem) {
    this.sourceIds.add(sourceIdsItem);
    return this;
  }

  /**
   * Source IDs of the URL filtering. Network can be created using 'Create LAN network' interface, and network ID can be obtained from 'Get LAN network list' interface. IP group can be created using 'Create a new group profile' interface, and IP group ID can be obtained from 'Get group profile list' interface. SSID can be created using 'Create new SSID' interface, and SSID ID can be obtained from 'Get SSID list' interface.
   * @return sourceIds
  */
  @ApiModelProperty(required = true, value = "Source IDs of the URL filtering. Network can be created using 'Create LAN network' interface, and network ID can be obtained from 'Get LAN network list' interface. IP group can be created using 'Create a new group profile' interface, and IP group ID can be obtained from 'Get group profile list' interface. SSID can be created using 'Create new SSID' interface, and SSID ID can be obtained from 'Get SSID list' interface.")
  @NotNull


  public List<String> getSourceIds() {
    return sourceIds;
  }

  public void setSourceIds(List<String> sourceIds) {
    this.sourceIds = sourceIds;
  }

  public UrlFilteringOpenApiVo mode(Integer mode) {
    this.mode = mode;
    return this;
  }

  /**
   * Mode should be a value as follows: 0: URL Path; 1: keywords(Only for gateway).
   * @return mode
  */
  @ApiModelProperty(required = true, value = "Mode should be a value as follows: 0: URL Path; 1: keywords(Only for gateway).")
  @NotNull


  public Integer getMode() {
    return mode;
  }

  public void setMode(Integer mode) {
    this.mode = mode;
  }

  public UrlFilteringOpenApiVo urls(List<String> urls) {
    this.urls = urls;
    return this;
  }

  public UrlFilteringOpenApiVo addUrlsItem(String urlsItem) {
    if (this.urls == null) {
      this.urls = new ArrayList<>();
    }
    this.urls.add(urlsItem);
    return this;
  }

  /**
   * URLs of the URL filtering, eg: www.google.com.
   * @return urls
  */
  @ApiModelProperty(value = "URLs of the URL filtering, eg: www.google.com.")


  public List<String> getUrls() {
    return urls;
  }

  public void setUrls(List<String> urls) {
    this.urls = urls;
  }

  public UrlFilteringOpenApiVo keywords(List<String> keywords) {
    this.keywords = keywords;
    return this;
  }

  public UrlFilteringOpenApiVo addKeywordsItem(String keywordsItem) {
    if (this.keywords == null) {
      this.keywords = new ArrayList<>();
    }
    this.keywords.add(keywordsItem);
    return this;
  }

  /**
   * Keywords of the URL filtering.
   * @return keywords
  */
  @ApiModelProperty(value = "Keywords of the URL filtering.")


  public List<String> getKeywords() {
    return keywords;
  }

  public void setKeywords(List<String> keywords) {
    this.keywords = keywords;
  }

  public UrlFilteringOpenApiVo filterMode(Integer filterMode) {
    this.filterMode = filterMode;
    return this;
  }

  /**
   * filterMode should be a value as follows: 0: URL; 1: category.
   * @return filterMode
  */
  @ApiModelProperty(required = true, value = "filterMode should be a value as follows: 0: URL; 1: category.")
  @NotNull


  public Integer getFilterMode() {
    return filterMode;
  }

  public void setFilterMode(Integer filterMode) {
    this.filterMode = filterMode;
  }

  public UrlFilteringOpenApiVo scenarioMode(Integer scenarioMode) {
    this.scenarioMode = scenarioMode;
    return this;
  }

  /**
   * scenarioMode should be a value as follows:0: Custom  1: Family 2：Work 3：Education 4：Guest.
   * @return scenarioMode
  */
  @ApiModelProperty(value = "scenarioMode should be a value as follows:0: Custom  1: Family 2：Work 3：Education 4：Guest.")


  public Integer getScenarioMode() {
    return scenarioMode;
  }

  public void setScenarioMode(Integer scenarioMode) {
    this.scenarioMode = scenarioMode;
  }

  public UrlFilteringOpenApiVo categories(Map<String, List<String>> categories) {
    this.categories = categories;
    return this;
  }

  public UrlFilteringOpenApiVo putCategoriesItem(String key, List<String> categoriesItem) {
    if (this.categories == null) {
      this.categories = new HashMap<>();
    }
    this.categories.put(key, categoriesItem);
    return this;
  }

  /**
   * categories of the URL filtering, TreeMap<String, List<String>> categories
   * @return categories
  */
  @ApiModelProperty(value = "categories of the URL filtering, TreeMap<String, List<String>> categories")

  @Valid

  public Map<String, List<String>> getCategories() {
    return categories;
  }

  public void setCategories(Map<String, List<String>> categories) {
    this.categories = categories;
  }

  public UrlFilteringOpenApiVo timeRange(String timeRange) {
    this.timeRange = timeRange;
    return this;
  }

  /**
   * timeRange of the URL filtering, TimeSchedule
   * @return timeRange
  */
  @ApiModelProperty(value = "timeRange of the URL filtering, TimeSchedule")


  public String getTimeRange() {
    return timeRange;
  }

  public void setTimeRange(String timeRange) {
    this.timeRange = timeRange;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    UrlFilteringOpenApiVo urlFilteringOpenApiVo = (UrlFilteringOpenApiVo) o;
    return Objects.equals(this.type, urlFilteringOpenApiVo.type) &&
        Objects.equals(this.name, urlFilteringOpenApiVo.name) &&
        Objects.equals(this.status, urlFilteringOpenApiVo.status) &&
        Objects.equals(this.policy, urlFilteringOpenApiVo.policy) &&
        Objects.equals(this.sourceType, urlFilteringOpenApiVo.sourceType) &&
        Objects.equals(this.sourceIds, urlFilteringOpenApiVo.sourceIds) &&
        Objects.equals(this.mode, urlFilteringOpenApiVo.mode) &&
        Objects.equals(this.urls, urlFilteringOpenApiVo.urls) &&
        Objects.equals(this.keywords, urlFilteringOpenApiVo.keywords) &&
        Objects.equals(this.filterMode, urlFilteringOpenApiVo.filterMode) &&
        Objects.equals(this.scenarioMode, urlFilteringOpenApiVo.scenarioMode) &&
        Objects.equals(this.categories, urlFilteringOpenApiVo.categories) &&
        Objects.equals(this.timeRange, urlFilteringOpenApiVo.timeRange);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, name, status, policy, sourceType, sourceIds, mode, urls, keywords, filterMode, scenarioMode, categories, timeRange);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class UrlFilteringOpenApiVo {\n");
    
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    policy: ").append(toIndentedString(policy)).append("\n");
    sb.append("    sourceType: ").append(toIndentedString(sourceType)).append("\n");
    sb.append("    sourceIds: ").append(toIndentedString(sourceIds)).append("\n");
    sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
    sb.append("    urls: ").append(toIndentedString(urls)).append("\n");
    sb.append("    keywords: ").append(toIndentedString(keywords)).append("\n");
    sb.append("    filterMode: ").append(toIndentedString(filterMode)).append("\n");
    sb.append("    scenarioMode: ").append(toIndentedString(scenarioMode)).append("\n");
    sb.append("    categories: ").append(toIndentedString(categories)).append("\n");
    sb.append("    timeRange: ").append(toIndentedString(timeRange)).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    ");
  }
}

