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;

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

public class BandwidthControl   {
  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("thresholdControlEnable")
  private Boolean thresholdControlEnable;

  @JsonProperty("thresholdValue")
  private Integer thresholdValue;

  @JsonProperty("bandwidthPortSettings")
  @Valid
  private List<BandwidthPortSetting> bandwidthPortSettings = null;

  public BandwidthControl enable(Boolean enable) {
    this.enable = enable;
    return this;
  }

  /**
   * Enable the bandwidth control.
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Enable the bandwidth control.")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

  public BandwidthControl thresholdControlEnable(Boolean thresholdControlEnable) {
    this.thresholdControlEnable = thresholdControlEnable;
    return this;
  }

  /**
   * Enable the threshold control of the bandwidth control.
   * @return thresholdControlEnable
  */
  @ApiModelProperty(value = "Enable the threshold control of the bandwidth control.")


  public Boolean getThresholdControlEnable() {
    return thresholdControlEnable;
  }

  public void setThresholdControlEnable(Boolean thresholdControlEnable) {
    this.thresholdControlEnable = thresholdControlEnable;
  }

  public BandwidthControl thresholdValue(Integer thresholdValue) {
    this.thresholdValue = thresholdValue;
    return this;
  }

  /**
   * Threshold value should be within the range of 1–100. Threshold value must be entered when threshold control is enable.
   * @return thresholdValue
  */
  @ApiModelProperty(value = "Threshold value should be within the range of 1–100. Threshold value must be entered when threshold control is enable.")


  public Integer getThresholdValue() {
    return thresholdValue;
  }

  public void setThresholdValue(Integer thresholdValue) {
    this.thresholdValue = thresholdValue;
  }

  public BandwidthControl bandwidthPortSettings(List<BandwidthPortSetting> bandwidthPortSettings) {
    this.bandwidthPortSettings = bandwidthPortSettings;
    return this;
  }

  public BandwidthControl addBandwidthPortSettingsItem(BandwidthPortSetting bandwidthPortSettingsItem) {
    if (this.bandwidthPortSettings == null) {
      this.bandwidthPortSettings = new ArrayList<>();
    }
    this.bandwidthPortSettings.add(bandwidthPortSettingsItem);
    return this;
  }

  /**
   * Bandwidth port settings of the bandwidth control.
   * @return bandwidthPortSettings
  */
  @ApiModelProperty(value = "Bandwidth port settings of the bandwidth control.")

  @Valid

  public List<BandwidthPortSetting> getBandwidthPortSettings() {
    return bandwidthPortSettings;
  }

  public void setBandwidthPortSettings(List<BandwidthPortSetting> bandwidthPortSettings) {
    this.bandwidthPortSettings = bandwidthPortSettings;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BandwidthControl bandwidthControl = (BandwidthControl) o;
    return Objects.equals(this.enable, bandwidthControl.enable) &&
        Objects.equals(this.thresholdControlEnable, bandwidthControl.thresholdControlEnable) &&
        Objects.equals(this.thresholdValue, bandwidthControl.thresholdValue) &&
        Objects.equals(this.bandwidthPortSettings, bandwidthControl.bandwidthPortSettings);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, thresholdControlEnable, thresholdValue, bandwidthPortSettings);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BandwidthControl {\n");
    
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    thresholdControlEnable: ").append(toIndentedString(thresholdControlEnable)).append("\n");
    sb.append("    thresholdValue: ").append(toIndentedString(thresholdValue)).append("\n");
    sb.append("    bandwidthPortSettings: ").append(toIndentedString(bandwidthPortSettings)).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    ");
  }
}

