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;

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

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

  @JsonProperty("index")
  private Integer index;

  @JsonProperty("name")
  private String name;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("protocols")
  @Valid
  private List<Integer> protocols = new ArrayList<>();

  @JsonProperty("interfaceType")
  private Integer interfaceType;

  @JsonProperty("interfaceId")
  private String interfaceId;

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

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

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

  @JsonProperty("backupInterface")
  private Boolean backupInterface;

  @JsonProperty("sourceType")
  private Integer sourceType;

  @JsonProperty("sourceIds")
  @Valid
  private List<String> sourceIds = new ArrayList<>();

  @JsonProperty("destinationType")
  private Integer destinationType;

  @JsonProperty("destinationIds")
  @Valid
  private List<String> destinationIds = new ArrayList<>();

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

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


  public String getId() {
    return id;
  }

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

  public PolicyRoutingInfo index(Integer index) {
    this.index = index;
    return this;
  }

  /**
   * Index
   * @return index
  */
  @ApiModelProperty(value = "Index")


  public Integer getIndex() {
    return index;
  }

  public void setIndex(Integer index) {
    this.index = index;
  }

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

  /**
   * Name, name should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Name, name should contain 1 to 64 characters.")
  @NotNull

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

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

  public PolicyRoutingInfo status(Boolean status) {
    this.status = status;
    return this;
  }

  /**
   * Status
   * @return status
  */
  @ApiModelProperty(required = true, value = "Status")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

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

  public PolicyRoutingInfo protocols(List<Integer> protocols) {
    this.protocols = protocols;
    return this;
  }

  public PolicyRoutingInfo addProtocolsItem(Integer protocolsItem) {
    this.protocols.add(protocolsItem);
    return this;
  }

  /**
   * For the values of protocols, refer to section 5.5.2 of the Open API Access Guide.
   * @return protocols
  */
  @ApiModelProperty(required = true, value = "For the values of protocols, refer to section 5.5.2 of the Open API Access Guide.")
  @NotNull


  public List<Integer> getProtocols() {
    return protocols;
  }

  public void setProtocols(List<Integer> protocols) {
    this.protocols = protocols;
  }

  public PolicyRoutingInfo interfaceType(Integer interfaceType) {
    this.interfaceType = interfaceType;
    return this;
  }

  /**
   * InterfaceType should be a value as follows: 0: WAN; 2: L2TP; 3: PPTP; 4: multi-select WAN or VPN or virtual WAN.
   * @return interfaceType
  */
  @ApiModelProperty(value = "InterfaceType should be a value as follows: 0: WAN; 2: L2TP; 3: PPTP; 4: multi-select WAN or VPN or virtual WAN.")


  public Integer getInterfaceType() {
    return interfaceType;
  }

  public void setInterfaceType(Integer interfaceType) {
    this.interfaceType = interfaceType;
  }

  public PolicyRoutingInfo interfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
    return this;
  }

  /**
   * Interface ID
   * @return interfaceId
  */
  @ApiModelProperty(value = "Interface ID")


  public String getInterfaceId() {
    return interfaceId;
  }

  public void setInterfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
  }

  public PolicyRoutingInfo wanPortIds(List<String> wanPortIds) {
    this.wanPortIds = wanPortIds;
    return this;
  }

  public PolicyRoutingInfo addWanPortIdsItem(String wanPortIdsItem) {
    if (this.wanPortIds == null) {
      this.wanPortIds = new ArrayList<>();
    }
    this.wanPortIds.add(wanPortIdsItem);
    return this;
  }

  /**
   * WAN port list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
   * @return wanPortIds
  */
  @ApiModelProperty(value = "WAN port list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.")


  public List<String> getWanPortIds() {
    return wanPortIds;
  }

  public void setWanPortIds(List<String> wanPortIds) {
    this.wanPortIds = wanPortIds;
  }

  public PolicyRoutingInfo vpnIds(List<String> vpnIds) {
    this.vpnIds = vpnIds;
    return this;
  }

  public PolicyRoutingInfo addVpnIdsItem(String vpnIdsItem) {
    if (this.vpnIds == null) {
      this.vpnIds = new ArrayList<>();
    }
    this.vpnIds.add(vpnIdsItem);
    return this;
  }

  /**
   * VPN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
   * @return vpnIds
  */
  @ApiModelProperty(value = "VPN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.")


  public List<String> getVpnIds() {
    return vpnIds;
  }

  public void setVpnIds(List<String> vpnIds) {
    this.vpnIds = vpnIds;
  }

  public PolicyRoutingInfo virtualWanIds(List<String> virtualWanIds) {
    this.virtualWanIds = virtualWanIds;
    return this;
  }

  public PolicyRoutingInfo addVirtualWanIdsItem(String virtualWanIdsItem) {
    if (this.virtualWanIds == null) {
      this.virtualWanIds = new ArrayList<>();
    }
    this.virtualWanIds.add(virtualWanIdsItem);
    return this;
  }

  /**
   * Virtual WAN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
   * @return virtualWanIds
  */
  @ApiModelProperty(value = "Virtual WAN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.")


  public List<String> getVirtualWanIds() {
    return virtualWanIds;
  }

  public void setVirtualWanIds(List<String> virtualWanIds) {
    this.virtualWanIds = virtualWanIds;
  }

  public PolicyRoutingInfo backupInterface(Boolean backupInterface) {
    this.backupInterface = backupInterface;
    return this;
  }

  /**
   * Use another WAN port if the current one is down
   * @return backupInterface
  */
  @ApiModelProperty(required = true, value = "Use another WAN port if the current one is down")
  @NotNull


  public Boolean getBackupInterface() {
    return backupInterface;
  }

  public void setBackupInterface(Boolean backupInterface) {
    this.backupInterface = backupInterface;
  }

  public PolicyRoutingInfo sourceType(Integer sourceType) {
    this.sourceType = sourceType;
    return this;
  }

  /**
   * SourceType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
   * @return sourceType
  */
  @ApiModelProperty(required = true, value = "SourceType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group")
  @NotNull


  public Integer getSourceType() {
    return sourceType;
  }

  public void setSourceType(Integer sourceType) {
    this.sourceType = sourceType;
  }

  public PolicyRoutingInfo sourceIds(List<String> sourceIds) {
    this.sourceIds = sourceIds;
    return this;
  }

  public PolicyRoutingInfo addSourceIdsItem(String sourceIdsItem) {
    this.sourceIds.add(sourceIdsItem);
    return this;
  }

  /**
   * Source IDs, which depends on sourceType, for example: if sourceType is network, sourceIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
   * @return sourceIds
  */
  @ApiModelProperty(required = true, value = "Source IDs, which depends on sourceType, for example: if sourceType is network, sourceIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.")
  @NotNull


  public List<String> getSourceIds() {
    return sourceIds;
  }

  public void setSourceIds(List<String> sourceIds) {
    this.sourceIds = sourceIds;
  }

  public PolicyRoutingInfo destinationType(Integer destinationType) {
    this.destinationType = destinationType;
    return this;
  }

  /**
   * DestinationType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
   * @return destinationType
  */
  @ApiModelProperty(required = true, value = "DestinationType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group")
  @NotNull


  public Integer getDestinationType() {
    return destinationType;
  }

  public void setDestinationType(Integer destinationType) {
    this.destinationType = destinationType;
  }

  public PolicyRoutingInfo destinationIds(List<String> destinationIds) {
    this.destinationIds = destinationIds;
    return this;
  }

  public PolicyRoutingInfo addDestinationIdsItem(String destinationIdsItem) {
    this.destinationIds.add(destinationIdsItem);
    return this;
  }

  /**
   * Destination IDs, which depends on destinationType, for example: if destinationType is network, destinationIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
   * @return destinationIds
  */
  @ApiModelProperty(required = true, value = "Destination IDs, which depends on destinationType, for example: if destinationType is network, destinationIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.")
  @NotNull


  public List<String> getDestinationIds() {
    return destinationIds;
  }

  public void setDestinationIds(List<String> destinationIds) {
    this.destinationIds = destinationIds;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PolicyRoutingInfo policyRoutingInfo = (PolicyRoutingInfo) o;
    return Objects.equals(this.id, policyRoutingInfo.id) &&
        Objects.equals(this.index, policyRoutingInfo.index) &&
        Objects.equals(this.name, policyRoutingInfo.name) &&
        Objects.equals(this.status, policyRoutingInfo.status) &&
        Objects.equals(this.protocols, policyRoutingInfo.protocols) &&
        Objects.equals(this.interfaceType, policyRoutingInfo.interfaceType) &&
        Objects.equals(this.interfaceId, policyRoutingInfo.interfaceId) &&
        Objects.equals(this.wanPortIds, policyRoutingInfo.wanPortIds) &&
        Objects.equals(this.vpnIds, policyRoutingInfo.vpnIds) &&
        Objects.equals(this.virtualWanIds, policyRoutingInfo.virtualWanIds) &&
        Objects.equals(this.backupInterface, policyRoutingInfo.backupInterface) &&
        Objects.equals(this.sourceType, policyRoutingInfo.sourceType) &&
        Objects.equals(this.sourceIds, policyRoutingInfo.sourceIds) &&
        Objects.equals(this.destinationType, policyRoutingInfo.destinationType) &&
        Objects.equals(this.destinationIds, policyRoutingInfo.destinationIds);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, index, name, status, protocols, interfaceType, interfaceId, wanPortIds, vpnIds, virtualWanIds, backupInterface, sourceType, sourceIds, destinationType, destinationIds);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PolicyRoutingInfo {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    index: ").append(toIndentedString(index)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    protocols: ").append(toIndentedString(protocols)).append("\n");
    sb.append("    interfaceType: ").append(toIndentedString(interfaceType)).append("\n");
    sb.append("    interfaceId: ").append(toIndentedString(interfaceId)).append("\n");
    sb.append("    wanPortIds: ").append(toIndentedString(wanPortIds)).append("\n");
    sb.append("    vpnIds: ").append(toIndentedString(vpnIds)).append("\n");
    sb.append("    virtualWanIds: ").append(toIndentedString(virtualWanIds)).append("\n");
    sb.append("    backupInterface: ").append(toIndentedString(backupInterface)).append("\n");
    sb.append("    sourceType: ").append(toIndentedString(sourceType)).append("\n");
    sb.append("    sourceIds: ").append(toIndentedString(sourceIds)).append("\n");
    sb.append("    destinationType: ").append(toIndentedString(destinationType)).append("\n");
    sb.append("    destinationIds: ").append(toIndentedString(destinationIds)).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    ");
  }
}

