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;

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

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

  @JsonProperty("status")
  private Boolean status;

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

  @JsonProperty("routeType")
  private Integer routeType;

  @JsonProperty("nextHopIp")
  private String nextHopIp;

  @JsonProperty("interfaceType")
  private Integer interfaceType;

  @JsonProperty("interfaceId")
  private String interfaceId;

  @JsonProperty("metric")
  private Integer metric;

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

  /**
   * Name, name should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name, 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 StaticRoutingConfig status(Boolean status) {
    this.status = status;
    return this;
  }

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


  public Boolean getStatus() {
    return status;
  }

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

  public StaticRoutingConfig destinations(List<String> destinations) {
    this.destinations = destinations;
    return this;
  }

  public StaticRoutingConfig addDestinationsItem(String destinationsItem) {
    this.destinations.add(destinationsItem);
    return this;
  }

  /**
   * IP address/SubNet
   * @return destinations
  */
  @ApiModelProperty(required = true, value = "IP address/SubNet")
  @NotNull


  public List<String> getDestinations() {
    return destinations;
  }

  public void setDestinations(List<String> destinations) {
    this.destinations = destinations;
  }

  public StaticRoutingConfig routeType(Integer routeType) {
    this.routeType = routeType;
    return this;
  }

  /**
   * RouteType should be a value as follows: 0: NextHop; 1: Interface
   * @return routeType
  */
  @ApiModelProperty(required = true, value = "RouteType should be a value as follows: 0: NextHop; 1: Interface")
  @NotNull


  public Integer getRouteType() {
    return routeType;
  }

  public void setRouteType(Integer routeType) {
    this.routeType = routeType;
  }

  public StaticRoutingConfig nextHopIp(String nextHopIp) {
    this.nextHopIp = nextHopIp;
    return this;
  }

  /**
   * Only for routeType:0 or routeType:1 and selected WAN is Static IP/Dynamic IP mode
   * @return nextHopIp
  */
  @ApiModelProperty(value = "Only for routeType:0 or routeType:1 and selected WAN is Static IP/Dynamic IP mode")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getNextHopIp() {
    return nextHopIp;
  }

  public void setNextHopIp(String nextHopIp) {
    this.nextHopIp = nextHopIp;
  }

  public StaticRoutingConfig interfaceType(Integer interfaceType) {
    this.interfaceType = interfaceType;
    return this;
  }

  /**
   * Only for routeType:1, interfaceType should be a value as follows: 0: Internet(WAN); 1: Network(LAN); 2: L2TP, 3: PPTP, 5: Virtual WAN.
   * @return interfaceType
  */
  @ApiModelProperty(value = "Only for routeType:1, interfaceType should be a value as follows: 0: Internet(WAN); 1: Network(LAN); 2: L2TP, 3: PPTP, 5: Virtual WAN.")


  public Integer getInterfaceType() {
    return interfaceType;
  }

  public void setInterfaceType(Integer interfaceType) {
    this.interfaceType = interfaceType;
  }

  public StaticRoutingConfig interfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
    return this;
  }

  /**
   * Interface ID, for example: if interfaceType is network, interfaceId should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
   * @return interfaceId
  */
  @ApiModelProperty(value = "Interface ID, for example: if interfaceType is network, interfaceId should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.")


  public String getInterfaceId() {
    return interfaceId;
  }

  public void setInterfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
  }

  public StaticRoutingConfig metric(Integer metric) {
    this.metric = metric;
    return this;
  }

  /**
   * Metric should be within the range of 0–15.
   * @return metric
  */
  @ApiModelProperty(required = true, value = "Metric should be within the range of 0–15.")
  @NotNull


  public Integer getMetric() {
    return metric;
  }

  public void setMetric(Integer metric) {
    this.metric = metric;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    StaticRoutingConfig staticRoutingConfig = (StaticRoutingConfig) o;
    return Objects.equals(this.name, staticRoutingConfig.name) &&
        Objects.equals(this.status, staticRoutingConfig.status) &&
        Objects.equals(this.destinations, staticRoutingConfig.destinations) &&
        Objects.equals(this.routeType, staticRoutingConfig.routeType) &&
        Objects.equals(this.nextHopIp, staticRoutingConfig.nextHopIp) &&
        Objects.equals(this.interfaceType, staticRoutingConfig.interfaceType) &&
        Objects.equals(this.interfaceId, staticRoutingConfig.interfaceId) &&
        Objects.equals(this.metric, staticRoutingConfig.metric);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, status, destinations, routeType, nextHopIp, interfaceType, interfaceId, metric);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class StaticRoutingConfig {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    destinations: ").append(toIndentedString(destinations)).append("\n");
    sb.append("    routeType: ").append(toIndentedString(routeType)).append("\n");
    sb.append("    nextHopIp: ").append(toIndentedString(nextHopIp)).append("\n");
    sb.append("    interfaceType: ").append(toIndentedString(interfaceType)).append("\n");
    sb.append("    interfaceId: ").append(toIndentedString(interfaceId)).append("\n");
    sb.append("    metric: ").append(toIndentedString(metric)).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    ");
  }
}

