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

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

public class WanLoadBalanceOpenApiVo   {
  @JsonProperty("weights")
  @Valid
  private List<Integer> weights = new ArrayList<>();

  @JsonProperty("appOptRouting")
  private Boolean appOptRouting;

  @JsonProperty("linkBackup")
  private Boolean linkBackup;

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

  @JsonProperty("backupWan")
  private String backupWan;

  @JsonProperty("backupMode")
  private Integer backupMode;

  @JsonProperty("mode")
  private Integer mode;

  public WanLoadBalanceOpenApiVo weights(List<Integer> weights) {
    this.weights = weights;
    return this;
  }

  public WanLoadBalanceOpenApiVo addWeightsItem(Integer weightsItem) {
    this.weights.add(weightsItem);
    return this;
  }

  /**
   * Load Balancing Weights, ranging from 1 to the max int value(2147483647). It is sorted by port ID.
   * @return weights
  */
  @ApiModelProperty(required = true, value = "Load Balancing Weights, ranging from 1 to the max int value(2147483647). It is sorted by port ID.")
  @NotNull


  public List<Integer> getWeights() {
    return weights;
  }

  public void setWeights(List<Integer> weights) {
    this.weights = weights;
  }

  public WanLoadBalanceOpenApiVo appOptRouting(Boolean appOptRouting) {
    this.appOptRouting = appOptRouting;
    return this;
  }

  /**
   * Application Optimized Routing
   * @return appOptRouting
  */
  @ApiModelProperty(required = true, value = "Application Optimized Routing")
  @NotNull


  public Boolean getAppOptRouting() {
    return appOptRouting;
  }

  public void setAppOptRouting(Boolean appOptRouting) {
    this.appOptRouting = appOptRouting;
  }

  public WanLoadBalanceOpenApiVo linkBackup(Boolean linkBackup) {
    this.linkBackup = linkBackup;
    return this;
  }

  /**
   * Link Backup
   * @return linkBackup
  */
  @ApiModelProperty(required = true, value = "Link Backup")
  @NotNull


  public Boolean getLinkBackup() {
    return linkBackup;
  }

  public void setLinkBackup(Boolean linkBackup) {
    this.linkBackup = linkBackup;
  }

  public WanLoadBalanceOpenApiVo primaryWans(List<String> primaryWans) {
    this.primaryWans = primaryWans;
    return this;
  }

  public WanLoadBalanceOpenApiVo addPrimaryWansItem(String primaryWansItem) {
    if (this.primaryWans == null) {
      this.primaryWans = new ArrayList<>();
    }
    this.primaryWans.add(primaryWansItem);
    return this;
  }

  /**
   * Primary WAN port IDs. It is required when [linkBackup] is true.
   * @return primaryWans
  */
  @ApiModelProperty(value = "Primary WAN port IDs. It is required when [linkBackup] is true.")


  public List<String> getPrimaryWans() {
    return primaryWans;
  }

  public void setPrimaryWans(List<String> primaryWans) {
    this.primaryWans = primaryWans;
  }

  public WanLoadBalanceOpenApiVo backupWan(String backupWan) {
    this.backupWan = backupWan;
    return this;
  }

  /**
   * Backup WAN ID. It is required when [linkBackup] is true.
   * @return backupWan
  */
  @ApiModelProperty(value = "Backup WAN ID. It is required when [linkBackup] is true.")


  public String getBackupWan() {
    return backupWan;
  }

  public void setBackupWan(String backupWan) {
    this.backupWan = backupWan;
  }

  public WanLoadBalanceOpenApiVo backupMode(Integer backupMode) {
    this.backupMode = backupMode;
    return this;
  }

  /**
   * It is required when [linkBackup] is true. 0: The system will try to forward the traffic via the backup WAN port when primary WAN fails. Even if the primary WAN is recovered, it will not switch back unless the backup WAN fails; 1: Traffic is always forwarded through the primary WAN port unless it fails. The system will try to forward the traffic via the backup WAN port when it fails, and switch back when it recovers.
   * @return backupMode
  */
  @ApiModelProperty(value = "It is required when [linkBackup] is true. 0: The system will try to forward the traffic via the backup WAN port when primary WAN fails. Even if the primary WAN is recovered, it will not switch back unless the backup WAN fails; 1: Traffic is always forwarded through the primary WAN port unless it fails. The system will try to forward the traffic via the backup WAN port when it fails, and switch back when it recovers.")


  public Integer getBackupMode() {
    return backupMode;
  }

  public void setBackupMode(Integer backupMode) {
    this.backupMode = backupMode;
  }

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

  /**
   * It is required when [linkBackup] is true. 0: Enable backup link when any primary WAN fails. 1: Enable backup link when all primary WANs fail.
   * @return mode
  */
  @ApiModelProperty(value = "It is required when [linkBackup] is true. 0: Enable backup link when any primary WAN fails. 1: Enable backup link when all primary WANs fail.")


  public Integer getMode() {
    return mode;
  }

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


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WanLoadBalanceOpenApiVo wanLoadBalanceOpenApiVo = (WanLoadBalanceOpenApiVo) o;
    return Objects.equals(this.weights, wanLoadBalanceOpenApiVo.weights) &&
        Objects.equals(this.appOptRouting, wanLoadBalanceOpenApiVo.appOptRouting) &&
        Objects.equals(this.linkBackup, wanLoadBalanceOpenApiVo.linkBackup) &&
        Objects.equals(this.primaryWans, wanLoadBalanceOpenApiVo.primaryWans) &&
        Objects.equals(this.backupWan, wanLoadBalanceOpenApiVo.backupWan) &&
        Objects.equals(this.backupMode, wanLoadBalanceOpenApiVo.backupMode) &&
        Objects.equals(this.mode, wanLoadBalanceOpenApiVo.mode);
  }

  @Override
  public int hashCode() {
    return Objects.hash(weights, appOptRouting, linkBackup, primaryWans, backupWan, backupMode, mode);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WanLoadBalanceOpenApiVo {\n");
    
    sb.append("    weights: ").append(toIndentedString(weights)).append("\n");
    sb.append("    appOptRouting: ").append(toIndentedString(appOptRouting)).append("\n");
    sb.append("    linkBackup: ").append(toIndentedString(linkBackup)).append("\n");
    sb.append("    primaryWans: ").append(toIndentedString(primaryWans)).append("\n");
    sb.append("    backupWan: ").append(toIndentedString(backupWan)).append("\n");
    sb.append("    backupMode: ").append(toIndentedString(backupMode)).append("\n");
    sb.append("    mode: ").append(toIndentedString(mode)).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    ");
  }
}

