package org.wfc.omada.api.sitesetting.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 javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class LanNetworkOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("purpose")
  private Integer purpose;

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

  @JsonProperty("vlanType")
  private Integer vlanType;

  @JsonProperty("vlans")
  private String vlans;

  @JsonProperty("vlan")
  private Integer vlan;

  @JsonProperty("application")
  private Integer application;

  @JsonProperty("gatewaySubnet")
  private String gatewaySubnet;

  @JsonProperty("dhcpSettingsVO")
  private DhcpSettings dhcpSettingsVO;

  @JsonProperty("domain")
  private String domain;

  @JsonProperty("igmpSnoopEnable")
  private Boolean igmpSnoopEnable;

  @JsonProperty("mldSnoopEnable")
  private Boolean mldSnoopEnable;

  @JsonProperty("dhcpL2RelayEnable")
  private Boolean dhcpL2RelayEnable;

  @JsonProperty("dhcpGuard")
  private DhcpServersSetting dhcpGuard;

  @JsonProperty("dhcpv6Guard")
  private Dhcpv6ServersSetting dhcpv6Guard;

  @JsonProperty("lanNeworkIpv6Config")
  private LanNetworkIpv6Config lanNeworkIpv6Config;

  @JsonProperty("allLan")
  private Boolean allLan;

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

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

  /**
   * LAN network purpose, 0: VLAN, 1: interface
   * @return purpose
  */
  @ApiModelProperty(required = true, value = "LAN network purpose, 0: VLAN, 1: interface")
  @NotNull


  public Integer getPurpose() {
    return purpose;
  }

  public void setPurpose(Integer purpose) {
    this.purpose = purpose;
  }

  public LanNetworkOpenApiVo interfaceIds(List<String> interfaceIds) {
    this.interfaceIds = interfaceIds;
    return this;
  }

  public LanNetworkOpenApiVo addInterfaceIdsItem(String interfaceIdsItem) {
    if (this.interfaceIds == null) {
      this.interfaceIds = new ArrayList<>();
    }
    this.interfaceIds.add(interfaceIdsItem);
    return this;
  }

  /**
   * Gateway LAN port IDs, which are acquired from \"Check WAN/LAN status\"
   * @return interfaceIds
  */
  @ApiModelProperty(value = "Gateway LAN port IDs, which are acquired from \"Check WAN/LAN status\"")


  public List<String> getInterfaceIds() {
    return interfaceIds;
  }

  public void setInterfaceIds(List<String> interfaceIds) {
    this.interfaceIds = interfaceIds;
  }

  public LanNetworkOpenApiVo vlanType(Integer vlanType) {
    this.vlanType = vlanType;
    return this;
  }

  /**
   * When purpose is interface, VLANType is valid. 0: Single; 1: Multiple
   * @return vlanType
  */
  @ApiModelProperty(value = "When purpose is interface, VLANType is valid. 0: Single; 1: Multiple")


  public Integer getVlanType() {
    return vlanType;
  }

  public void setVlanType(Integer vlanType) {
    this.vlanType = vlanType;
  }

  public LanNetworkOpenApiVo vlans(String vlans) {
    this.vlans = vlans;
    return this;
  }

  /**
   * When purpose is \"interface\" and VLANType is 1, batch create VLANs. VLAN format: 200, 1-100.
   * @return vlans
  */
  @ApiModelProperty(value = "When purpose is \"interface\" and VLANType is 1, batch create VLANs. VLAN format: 200, 1-100.")

@Pattern(regexp="^[\\d|\\d-\\d]+(,[\\d|\\d-\\d]+)*$") 
  public String getVlans() {
    return vlans;
  }

  public void setVlans(String vlans) {
    this.vlans = vlans;
  }

  public LanNetworkOpenApiVo vlan(Integer vlan) {
    this.vlan = vlan;
    return this;
  }

  /**
   * When purpose is \"VLAN\" or purpose is \"interface\" and VLANType is 0, create VLAN, which ranges from 1 to 4090.
   * @return vlan
  */
  @ApiModelProperty(value = "When purpose is \"VLAN\" or purpose is \"interface\" and VLANType is 0, create VLAN, which ranges from 1 to 4090.")


  public Integer getVlan() {
    return vlan;
  }

  public void setVlan(Integer vlan) {
    this.vlan = vlan;
  }

  public LanNetworkOpenApiVo application(Integer application) {
    this.application = application;
    return this;
  }

  /**
   * Effective device type, 0: Gateway, Switch; 1: Switch
   * @return application
  */
  @ApiModelProperty(value = "Effective device type, 0: Gateway, Switch; 1: Switch")


  public Integer getApplication() {
    return application;
  }

  public void setApplication(Integer application) {
    this.application = application;
  }

  public LanNetworkOpenApiVo gatewaySubnet(String gatewaySubnet) {
    this.gatewaySubnet = gatewaySubnet;
    return this;
  }

  /**
   * When purpose is interface, gateway subnet is needed. Format: IP/Mask
   * @return gatewaySubnet
  */
  @ApiModelProperty(value = "When purpose is interface, gateway subnet is needed. Format: IP/Mask")

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])/(\\d|((1|2)\\d)|(30))\\b") 
  public String getGatewaySubnet() {
    return gatewaySubnet;
  }

  public void setGatewaySubnet(String gatewaySubnet) {
    this.gatewaySubnet = gatewaySubnet;
  }

  public LanNetworkOpenApiVo dhcpSettingsVO(DhcpSettings dhcpSettingsVO) {
    this.dhcpSettingsVO = dhcpSettingsVO;
    return this;
  }

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

  @Valid

  public DhcpSettings getDhcpSettingsVO() {
    return dhcpSettingsVO;
  }

  public void setDhcpSettingsVO(DhcpSettings dhcpSettingsVO) {
    this.dhcpSettingsVO = dhcpSettingsVO;
  }

  public LanNetworkOpenApiVo domain(String domain) {
    this.domain = domain;
    return this;
  }

  /**
   * The domain of this network
   * @return domain
  */
  @ApiModelProperty(value = "The domain of this network")

@Pattern(regexp="((\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])(\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])){3}|([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6})") 
  public String getDomain() {
    return domain;
  }

  public void setDomain(String domain) {
    this.domain = domain;
  }

  public LanNetworkOpenApiVo igmpSnoopEnable(Boolean igmpSnoopEnable) {
    this.igmpSnoopEnable = igmpSnoopEnable;
    return this;
  }

  /**
   * Enable IGMP snooping
   * @return igmpSnoopEnable
  */
  @ApiModelProperty(required = true, value = "Enable IGMP snooping")
  @NotNull


  public Boolean getIgmpSnoopEnable() {
    return igmpSnoopEnable;
  }

  public void setIgmpSnoopEnable(Boolean igmpSnoopEnable) {
    this.igmpSnoopEnable = igmpSnoopEnable;
  }

  public LanNetworkOpenApiVo mldSnoopEnable(Boolean mldSnoopEnable) {
    this.mldSnoopEnable = mldSnoopEnable;
    return this;
  }

  /**
   * Enable MLD snooping
   * @return mldSnoopEnable
  */
  @ApiModelProperty(value = "Enable MLD snooping")


  public Boolean getMldSnoopEnable() {
    return mldSnoopEnable;
  }

  public void setMldSnoopEnable(Boolean mldSnoopEnable) {
    this.mldSnoopEnable = mldSnoopEnable;
  }

  public LanNetworkOpenApiVo dhcpL2RelayEnable(Boolean dhcpL2RelayEnable) {
    this.dhcpL2RelayEnable = dhcpL2RelayEnable;
    return this;
  }

  /**
   * The switch of DHCP L2 relay
   * @return dhcpL2RelayEnable
  */
  @ApiModelProperty(value = "The switch of DHCP L2 relay")


  public Boolean getDhcpL2RelayEnable() {
    return dhcpL2RelayEnable;
  }

  public void setDhcpL2RelayEnable(Boolean dhcpL2RelayEnable) {
    this.dhcpL2RelayEnable = dhcpL2RelayEnable;
  }

  public LanNetworkOpenApiVo dhcpGuard(DhcpServersSetting dhcpGuard) {
    this.dhcpGuard = dhcpGuard;
    return this;
  }

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

  @Valid

  public DhcpServersSetting getDhcpGuard() {
    return dhcpGuard;
  }

  public void setDhcpGuard(DhcpServersSetting dhcpGuard) {
    this.dhcpGuard = dhcpGuard;
  }

  public LanNetworkOpenApiVo dhcpv6Guard(Dhcpv6ServersSetting dhcpv6Guard) {
    this.dhcpv6Guard = dhcpv6Guard;
    return this;
  }

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

  @Valid

  public Dhcpv6ServersSetting getDhcpv6Guard() {
    return dhcpv6Guard;
  }

  public void setDhcpv6Guard(Dhcpv6ServersSetting dhcpv6Guard) {
    this.dhcpv6Guard = dhcpv6Guard;
  }

  public LanNetworkOpenApiVo lanNeworkIpv6Config(LanNetworkIpv6Config lanNeworkIpv6Config) {
    this.lanNeworkIpv6Config = lanNeworkIpv6Config;
    return this;
  }

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

  @Valid

  public LanNetworkIpv6Config getLanNeworkIpv6Config() {
    return lanNeworkIpv6Config;
  }

  public void setLanNeworkIpv6Config(LanNetworkIpv6Config lanNeworkIpv6Config) {
    this.lanNeworkIpv6Config = lanNeworkIpv6Config;
  }

  public LanNetworkOpenApiVo allLan(Boolean allLan) {
    this.allLan = allLan;
    return this;
  }

  /**
   * When Internet pre-config is closed or Internet pre-config is Universal, allLAN is \"true\"; after adopting gateway, allLAN is \"false\".
   * @return allLan
  */
  @ApiModelProperty(value = "When Internet pre-config is closed or Internet pre-config is Universal, allLAN is \"true\"; after adopting gateway, allLAN is \"false\".")


  public Boolean getAllLan() {
    return allLan;
  }

  public void setAllLan(Boolean allLan) {
    this.allLan = allLan;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    LanNetworkOpenApiVo lanNetworkOpenApiVo = (LanNetworkOpenApiVo) o;
    return Objects.equals(this.name, lanNetworkOpenApiVo.name) &&
        Objects.equals(this.purpose, lanNetworkOpenApiVo.purpose) &&
        Objects.equals(this.interfaceIds, lanNetworkOpenApiVo.interfaceIds) &&
        Objects.equals(this.vlanType, lanNetworkOpenApiVo.vlanType) &&
        Objects.equals(this.vlans, lanNetworkOpenApiVo.vlans) &&
        Objects.equals(this.vlan, lanNetworkOpenApiVo.vlan) &&
        Objects.equals(this.application, lanNetworkOpenApiVo.application) &&
        Objects.equals(this.gatewaySubnet, lanNetworkOpenApiVo.gatewaySubnet) &&
        Objects.equals(this.dhcpSettingsVO, lanNetworkOpenApiVo.dhcpSettingsVO) &&
        Objects.equals(this.domain, lanNetworkOpenApiVo.domain) &&
        Objects.equals(this.igmpSnoopEnable, lanNetworkOpenApiVo.igmpSnoopEnable) &&
        Objects.equals(this.mldSnoopEnable, lanNetworkOpenApiVo.mldSnoopEnable) &&
        Objects.equals(this.dhcpL2RelayEnable, lanNetworkOpenApiVo.dhcpL2RelayEnable) &&
        Objects.equals(this.dhcpGuard, lanNetworkOpenApiVo.dhcpGuard) &&
        Objects.equals(this.dhcpv6Guard, lanNetworkOpenApiVo.dhcpv6Guard) &&
        Objects.equals(this.lanNeworkIpv6Config, lanNetworkOpenApiVo.lanNeworkIpv6Config) &&
        Objects.equals(this.allLan, lanNetworkOpenApiVo.allLan);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, purpose, interfaceIds, vlanType, vlans, vlan, application, gatewaySubnet, dhcpSettingsVO, domain, igmpSnoopEnable, mldSnoopEnable, dhcpL2RelayEnable, dhcpGuard, dhcpv6Guard, lanNeworkIpv6Config, allLan);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class LanNetworkOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    purpose: ").append(toIndentedString(purpose)).append("\n");
    sb.append("    interfaceIds: ").append(toIndentedString(interfaceIds)).append("\n");
    sb.append("    vlanType: ").append(toIndentedString(vlanType)).append("\n");
    sb.append("    vlans: ").append(toIndentedString(vlans)).append("\n");
    sb.append("    vlan: ").append(toIndentedString(vlan)).append("\n");
    sb.append("    application: ").append(toIndentedString(application)).append("\n");
    sb.append("    gatewaySubnet: ").append(toIndentedString(gatewaySubnet)).append("\n");
    sb.append("    dhcpSettingsVO: ").append(toIndentedString(dhcpSettingsVO)).append("\n");
    sb.append("    domain: ").append(toIndentedString(domain)).append("\n");
    sb.append("    igmpSnoopEnable: ").append(toIndentedString(igmpSnoopEnable)).append("\n");
    sb.append("    mldSnoopEnable: ").append(toIndentedString(mldSnoopEnable)).append("\n");
    sb.append("    dhcpL2RelayEnable: ").append(toIndentedString(dhcpL2RelayEnable)).append("\n");
    sb.append("    dhcpGuard: ").append(toIndentedString(dhcpGuard)).append("\n");
    sb.append("    dhcpv6Guard: ").append(toIndentedString(dhcpv6Guard)).append("\n");
    sb.append("    lanNeworkIpv6Config: ").append(toIndentedString(lanNeworkIpv6Config)).append("\n");
    sb.append("    allLan: ").append(toIndentedString(allLan)).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    ");
  }
}

