package org.wfc.omada.api.device.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;

/**
 * gateway port config entity
 */
@ApiModel(description = "gateway port config entity")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:26:25.576+08:00[Asia/Shanghai]")

public class GatewayPortConfig   {
  @JsonProperty("port")
  private Integer port;

  @JsonProperty("linkSpeed")
  private Integer linkSpeed;

  @JsonProperty("duplex")
  private Integer duplex;

  @JsonProperty("mirrorEnable")
  private Boolean mirrorEnable;

  @JsonProperty("mirroredPorts")
  @Valid
  private List<Integer> mirroredPorts = null;

  @JsonProperty("mirrorMode")
  private Integer mirrorMode;

  @JsonProperty("pvid")
  private Integer pvid;

  @JsonProperty("flowControl")
  private Boolean flowControl;

  @JsonProperty("status")
  private Integer status;

  @JsonProperty("dslSettings")
  private DslSettings dslSettings;

  public GatewayPortConfig port(Integer port) {
    this.port = port;
    return this;
  }

  /**
   * Port serial number
   * @return port
  */
  @ApiModelProperty(required = true, value = "Port serial number")
  @NotNull


  public Integer getPort() {
    return port;
  }

  public void setPort(Integer port) {
    this.port = port;
  }

  public GatewayPortConfig linkSpeed(Integer linkSpeed) {
    this.linkSpeed = linkSpeed;
    return this;
  }

  /**
   * Port link speed should be a value as follows: 0: Auto; 1: 10M; 2: 100M; 3: 1000M; 4: 2500M; 5: 10G; 6: 5G
   * @return linkSpeed
  */
  @ApiModelProperty(value = "Port link speed should be a value as follows: 0: Auto; 1: 10M; 2: 100M; 3: 1000M; 4: 2500M; 5: 10G; 6: 5G")


  public Integer getLinkSpeed() {
    return linkSpeed;
  }

  public void setLinkSpeed(Integer linkSpeed) {
    this.linkSpeed = linkSpeed;
  }

  public GatewayPortConfig duplex(Integer duplex) {
    this.duplex = duplex;
    return this;
  }

  /**
   * Port duplex mode should be a value as follows: 0: Auto; 1: Half; 2: Full
   * @return duplex
  */
  @ApiModelProperty(value = "Port duplex mode should be a value as follows: 0: Auto; 1: Half; 2: Full")


  public Integer getDuplex() {
    return duplex;
  }

  public void setDuplex(Integer duplex) {
    this.duplex = duplex;
  }

  public GatewayPortConfig mirrorEnable(Boolean mirrorEnable) {
    this.mirrorEnable = mirrorEnable;
    return this;
  }

  /**
   * Port enabled mirror or not
   * @return mirrorEnable
  */
  @ApiModelProperty(value = "Port enabled mirror or not")


  public Boolean getMirrorEnable() {
    return mirrorEnable;
  }

  public void setMirrorEnable(Boolean mirrorEnable) {
    this.mirrorEnable = mirrorEnable;
  }

  public GatewayPortConfig mirroredPorts(List<Integer> mirroredPorts) {
    this.mirroredPorts = mirroredPorts;
    return this;
  }

  public GatewayPortConfig addMirroredPortsItem(Integer mirroredPortsItem) {
    if (this.mirroredPorts == null) {
      this.mirroredPorts = new ArrayList<>();
    }
    this.mirroredPorts.add(mirroredPortsItem);
    return this;
  }

  /**
   * Mirrored Ports Set
   * @return mirroredPorts
  */
  @ApiModelProperty(value = "Mirrored Ports Set")


  public List<Integer> getMirroredPorts() {
    return mirroredPorts;
  }

  public void setMirroredPorts(List<Integer> mirroredPorts) {
    this.mirroredPorts = mirroredPorts;
  }

  public GatewayPortConfig mirrorMode(Integer mirrorMode) {
    this.mirrorMode = mirrorMode;
    return this;
  }

  /**
   * Port mirror mode should be a value as follows: 0: ingress; 1: egress; 2: ingress and egress
   * @return mirrorMode
  */
  @ApiModelProperty(value = "Port mirror mode should be a value as follows: 0: ingress; 1: egress; 2: ingress and egress")


  public Integer getMirrorMode() {
    return mirrorMode;
  }

  public void setMirrorMode(Integer mirrorMode) {
    this.mirrorMode = mirrorMode;
  }

  public GatewayPortConfig pvid(Integer pvid) {
    this.pvid = pvid;
    return this;
  }

  /**
   * Pvid(only for lan port.)
   * @return pvid
  */
  @ApiModelProperty(value = "Pvid(only for lan port.)")


  public Integer getPvid() {
    return pvid;
  }

  public void setPvid(Integer pvid) {
    this.pvid = pvid;
  }

  public GatewayPortConfig flowControl(Boolean flowControl) {
    this.flowControl = flowControl;
    return this;
  }

  /**
   * Enable flow control or not.(When the port supports flow control.)
   * @return flowControl
  */
  @ApiModelProperty(value = "Enable flow control or not.(When the port supports flow control.)")


  public Boolean getFlowControl() {
    return flowControl;
  }

  public void setFlowControl(Boolean flowControl) {
    this.flowControl = flowControl;
  }

  public GatewayPortConfig status(Integer status) {
    this.status = status;
    return this;
  }

  /**
   * Enable port or not, status should be a value as follows: 0: disable; 1: enable.(When the port supports status.)
   * @return status
  */
  @ApiModelProperty(value = "Enable port or not, status should be a value as follows: 0: disable; 1: enable.(When the port supports status.)")


  public Integer getStatus() {
    return status;
  }

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

  public GatewayPortConfig dslSettings(DslSettings dslSettings) {
    this.dslSettings = dslSettings;
    return this;
  }

  /**
   * Get dslSettings
   * @return dslSettings
  */
  @ApiModelProperty(value = "")

  @Valid

  public DslSettings getDslSettings() {
    return dslSettings;
  }

  public void setDslSettings(DslSettings dslSettings) {
    this.dslSettings = dslSettings;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GatewayPortConfig gatewayPortConfig = (GatewayPortConfig) o;
    return Objects.equals(this.port, gatewayPortConfig.port) &&
        Objects.equals(this.linkSpeed, gatewayPortConfig.linkSpeed) &&
        Objects.equals(this.duplex, gatewayPortConfig.duplex) &&
        Objects.equals(this.mirrorEnable, gatewayPortConfig.mirrorEnable) &&
        Objects.equals(this.mirroredPorts, gatewayPortConfig.mirroredPorts) &&
        Objects.equals(this.mirrorMode, gatewayPortConfig.mirrorMode) &&
        Objects.equals(this.pvid, gatewayPortConfig.pvid) &&
        Objects.equals(this.flowControl, gatewayPortConfig.flowControl) &&
        Objects.equals(this.status, gatewayPortConfig.status) &&
        Objects.equals(this.dslSettings, gatewayPortConfig.dslSettings);
  }

  @Override
  public int hashCode() {
    return Objects.hash(port, linkSpeed, duplex, mirrorEnable, mirroredPorts, mirrorMode, pvid, flowControl, status, dslSettings);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GatewayPortConfig {\n");
    
    sb.append("    port: ").append(toIndentedString(port)).append("\n");
    sb.append("    linkSpeed: ").append(toIndentedString(linkSpeed)).append("\n");
    sb.append("    duplex: ").append(toIndentedString(duplex)).append("\n");
    sb.append("    mirrorEnable: ").append(toIndentedString(mirrorEnable)).append("\n");
    sb.append("    mirroredPorts: ").append(toIndentedString(mirroredPorts)).append("\n");
    sb.append("    mirrorMode: ").append(toIndentedString(mirrorMode)).append("\n");
    sb.append("    pvid: ").append(toIndentedString(pvid)).append("\n");
    sb.append("    flowControl: ").append(toIndentedString(flowControl)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    dslSettings: ").append(toIndentedString(dslSettings)).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    ");
  }
}

