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

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

public class OuiBasedVlanSwitchQueryOpenApiVo   {
  @JsonProperty("id")
  private String id;

  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("name")
  private String name;

  @JsonProperty("mode")
  private Integer mode;

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

  @JsonProperty("ruleCombine")
  @Valid
  private List<VlanOuiModeQueryOpenApiVo> ruleCombine = null;

  public OuiBasedVlanSwitchQueryOpenApiVo id(String id) {
    this.id = id;
    return this;
  }

  /**
   * Rule ID
   * @return id
  */
  @ApiModelProperty(value = "Rule ID")


  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

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

  /**
   * Switch Rule state.
   * @return enable
  */
  @ApiModelProperty(value = "Switch Rule state.")


  public Boolean getEnable() {
    return enable;
  }

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

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

  /**
   * Switch Rule name should contain 1 to 128 characters.
   * @return name
  */
  @ApiModelProperty(value = "Switch Rule name should contain 1 to 128 characters.")

@Pattern(regexp="^[^ ]$|^[^ ].{0,126}[^ ]$") 
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

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

  /**
   * Switch Rule type should be a value as follows: 0: All device port; 1: Custom device port
   * @return mode
  */
  @ApiModelProperty(value = "Switch Rule type should be a value as follows: 0: All device port; 1: Custom device port")


  public Integer getMode() {
    return mode;
  }

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

  public OuiBasedVlanSwitchQueryOpenApiVo deviceList(List<DeviceOuiModeQueryOpenApiVo> deviceList) {
    this.deviceList = deviceList;
    return this;
  }

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

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

  @Valid

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

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

  public OuiBasedVlanSwitchQueryOpenApiVo ruleCombine(List<VlanOuiModeQueryOpenApiVo> ruleCombine) {
    this.ruleCombine = ruleCombine;
    return this;
  }

  public OuiBasedVlanSwitchQueryOpenApiVo addRuleCombineItem(VlanOuiModeQueryOpenApiVo ruleCombineItem) {
    if (this.ruleCombine == null) {
      this.ruleCombine = new ArrayList<>();
    }
    this.ruleCombine.add(ruleCombineItem);
    return this;
  }

  /**
   * Basic vlan-oui-priority configuration of oui based vlan rule.
   * @return ruleCombine
  */
  @ApiModelProperty(value = "Basic vlan-oui-priority configuration of oui based vlan rule.")

  @Valid

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

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


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

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

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

