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

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

public class PortScheduleOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("turnOnTime")
  private String turnOnTime;

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

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

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

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

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

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

  /**
   * Port Schedule Status.
   * @return status
  */
  @ApiModelProperty(required = true, value = "Port Schedule Status.")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

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

  public PortScheduleOpenApiVo turnOnTime(String turnOnTime) {
    this.turnOnTime = turnOnTime;
    return this;
  }

  /**
   * Time Range ID, cannot be empty.
   * @return turnOnTime
  */
  @ApiModelProperty(required = true, value = "Time Range ID, cannot be empty.")
  @NotNull


  public String getTurnOnTime() {
    return turnOnTime;
  }

  public void setTurnOnTime(String turnOnTime) {
    this.turnOnTime = turnOnTime;
  }

  public PortScheduleOpenApiVo portsMap(Map<String, List<Integer>> portsMap) {
    this.portsMap = portsMap;
    return this;
  }

  public PortScheduleOpenApiVo putPortsMapItem(String key, List<Integer> portsMapItem) {
    this.portsMap.put(key, portsMapItem);
    return this;
  }

  /**
   * Key:MAC(\"String\"), Value:Set of Ports(\"Integer\")
   * @return portsMap
  */
  @ApiModelProperty(required = true, value = "Key:MAC(\"String\"), Value:Set of Ports(\"Integer\")")
  @NotNull

  @Valid

  public Map<String, List<Integer>> getPortsMap() {
    return portsMap;
  }

  public void setPortsMap(Map<String, List<Integer>> portsMap) {
    this.portsMap = portsMap;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PortScheduleOpenApiVo portScheduleOpenApiVo = (PortScheduleOpenApiVo) o;
    return Objects.equals(this.name, portScheduleOpenApiVo.name) &&
        Objects.equals(this.status, portScheduleOpenApiVo.status) &&
        Objects.equals(this.turnOnTime, portScheduleOpenApiVo.turnOnTime) &&
        Objects.equals(this.portsMap, portScheduleOpenApiVo.portsMap);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, status, turnOnTime, portsMap);
  }

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

