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;

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

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

  @JsonProperty("name")
  private String name;

  @JsonProperty("mode")
  private Integer mode;

  @JsonProperty("deviceList")
  @Valid
  private List<DeviceOuiModeOpenApiVo> deviceList = null;

  @JsonProperty("ruleCombine")
  @Valid
  private List<VlanOuiModeOpenApiVo> ruleCombine = new ArrayList<>();

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

  /**
   * Switch Rule state.
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Switch Rule state.")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

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

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

  /**
   * Switch Rule name should contain 1 to 128 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Switch Rule 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 OuiBasedVlanSwitchOpenApiVo mode(Integer mode) {
    this.mode = mode;
    return this;
  }

  /**
   * Switch Rule type. 0:\"All device port\", 1:\"Custom device port\"
   * @return mode
  */
  @ApiModelProperty(required = true, value = "Switch Rule type. 0:\"All device port\", 1:\"Custom device port\"")
  @NotNull


  public Integer getMode() {
    return mode;
  }

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

  public OuiBasedVlanSwitchOpenApiVo deviceList(List<DeviceOuiModeOpenApiVo> deviceList) {
    this.deviceList = deviceList;
    return this;
  }

  public OuiBasedVlanSwitchOpenApiVo addDeviceListItem(DeviceOuiModeOpenApiVo deviceListItem) {
    if (this.deviceList == null) {
      this.deviceList = new ArrayList<>();
    }
    this.deviceList.add(deviceListItem);
    return this;
  }

  /**
   * When mode is 0, should configure device info.
   * @return deviceList
  */
  @ApiModelProperty(value = "When mode is 0, should configure device info.")

  @Valid

  public List<DeviceOuiModeOpenApiVo> getDeviceList() {
    return deviceList;
  }

  public void setDeviceList(List<DeviceOuiModeOpenApiVo> deviceList) {
    this.deviceList = deviceList;
  }

  public OuiBasedVlanSwitchOpenApiVo ruleCombine(List<VlanOuiModeOpenApiVo> ruleCombine) {
    this.ruleCombine = ruleCombine;
    return this;
  }

  public OuiBasedVlanSwitchOpenApiVo addRuleCombineItem(VlanOuiModeOpenApiVo ruleCombineItem) {
    this.ruleCombine.add(ruleCombineItem);
    return this;
  }

  /**
   * Basic vlan-oui-priority configuration of oui based rule. Cannot be empty.
   * @return ruleCombine
  */
  @ApiModelProperty(required = true, value = "Basic vlan-oui-priority configuration of oui based rule. Cannot be empty.")
  @NotNull

  @Valid

  public List<VlanOuiModeOpenApiVo> getRuleCombine() {
    return ruleCombine;
  }

  public void setRuleCombine(List<VlanOuiModeOpenApiVo> ruleCombine) {
    this.ruleCombine = ruleCombine;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OuiBasedVlanSwitchOpenApiVo ouiBasedVlanSwitchOpenApiVo = (OuiBasedVlanSwitchOpenApiVo) o;
    return Objects.equals(this.enable, ouiBasedVlanSwitchOpenApiVo.enable) &&
        Objects.equals(this.name, ouiBasedVlanSwitchOpenApiVo.name) &&
        Objects.equals(this.mode, ouiBasedVlanSwitchOpenApiVo.mode) &&
        Objects.equals(this.deviceList, ouiBasedVlanSwitchOpenApiVo.deviceList) &&
        Objects.equals(this.ruleCombine, ouiBasedVlanSwitchOpenApiVo.ruleCombine);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, name, mode, deviceList, ruleCombine);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OuiBasedVlanSwitchOpenApiVo {\n");
    
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
    sb.append("    deviceList: ").append(toIndentedString(deviceList)).append("\n");
    sb.append("    ruleCombine: ").append(toIndentedString(ruleCombine)).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    ");
  }
}

