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;

/**
 * Location and ISP info, including index and name.
 */
@ApiModel(description = "Location and ISP info, including index and name.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class LocationOpenApiVo   {
  @JsonProperty("index")
  private Integer index;

  @JsonProperty("name")
  private String name;

  @JsonProperty("ispInfo")
  @Valid
  private List<IspOpenApiVo> ispInfo = null;

  public LocationOpenApiVo index(Integer index) {
    this.index = index;
    return this;
  }

  /**
   * Location index
   * @return index
  */
  @ApiModelProperty(required = true, value = "Location index")
  @NotNull


  public Integer getIndex() {
    return index;
  }

  public void setIndex(Integer index) {
    this.index = index;
  }

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

  /**
   * Location name
   * @return name
  */
  @ApiModelProperty(required = true, value = "Location name")
  @NotNull


  public String getName() {
    return name;
  }

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

  public LocationOpenApiVo ispInfo(List<IspOpenApiVo> ispInfo) {
    this.ispInfo = ispInfo;
    return this;
  }

  public LocationOpenApiVo addIspInfoItem(IspOpenApiVo ispInfoItem) {
    if (this.ispInfo == null) {
      this.ispInfo = new ArrayList<>();
    }
    this.ispInfo.add(ispInfoItem);
    return this;
  }

  /**
   * ISP info in the location, including index and name
   * @return ispInfo
  */
  @ApiModelProperty(value = "ISP info in the location, including index and name")

  @Valid

  public List<IspOpenApiVo> getIspInfo() {
    return ispInfo;
  }

  public void setIspInfo(List<IspOpenApiVo> ispInfo) {
    this.ispInfo = ispInfo;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    LocationOpenApiVo locationOpenApiVo = (LocationOpenApiVo) o;
    return Objects.equals(this.index, locationOpenApiVo.index) &&
        Objects.equals(this.name, locationOpenApiVo.name) &&
        Objects.equals(this.ispInfo, locationOpenApiVo.ispInfo);
  }

  @Override
  public int hashCode() {
    return Objects.hash(index, name, ispInfo);
  }

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

