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

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

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

  @JsonProperty("indexes")
  @Valid
  private Map<String, Integer> indexes = new HashMap<>();

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

  /**
   * Type must be gateway or ap
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type must be gateway or ap")
  @NotNull

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

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

  public UrlDragSortIndexOpenapiVo indexes(Map<String, Integer> indexes) {
    this.indexes = indexes;
    return this;
  }

  public UrlDragSortIndexOpenapiVo putIndexesItem(String key, Integer indexesItem) {
    this.indexes.put(key, indexesItem);
    return this;
  }

  /**
   * The order in which items take effect, this object is a Map, the key is item ID and the value is the index you want to set.
   * @return indexes
  */
  @ApiModelProperty(required = true, value = "The order in which items take effect, this object is a Map, the key is item ID and the value is the index you want to set.")
  @NotNull


  public Map<String, Integer> getIndexes() {
    return indexes;
  }

  public void setIndexes(Map<String, Integer> indexes) {
    this.indexes = indexes;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    UrlDragSortIndexOpenapiVo urlDragSortIndexOpenapiVo = (UrlDragSortIndexOpenapiVo) o;
    return Objects.equals(this.type, urlDragSortIndexOpenapiVo.type) &&
        Objects.equals(this.indexes, urlDragSortIndexOpenapiVo.indexes);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, indexes);
  }

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

