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;

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

public class SwitchAclConfig   {
  @JsonProperty("description")
  private String description;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("policy")
  private Integer policy;

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

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

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

  @JsonProperty("sourceType")
  private Integer sourceType;

  @JsonProperty("destinationType")
  private Integer destinationType;

  @JsonProperty("bindingType")
  private Integer bindingType;

  @JsonProperty("customAclPorts")
  @Valid
  private List<SwitchAclPortEntity> customAclPorts = null;

  @JsonProperty("networkId")
  private String networkId;

  @JsonProperty("bindingBridgeVlan")
  private Integer bindingBridgeVlan;

  @JsonProperty("etherType")
  private SwitchAclEtherTypeEntity etherType;

  @JsonProperty("timeRangeId")
  private String timeRangeId;

  @JsonProperty("biDirectional")
  private Boolean biDirectional;

  public SwitchAclConfig description(String description) {
    this.description = description;
    return this;
  }

  /**
   * ACL rule description, description should contain 1 to 512 characters.
   * @return description
  */
  @ApiModelProperty(required = true, value = "ACL rule description, description should contain 1 to 512 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,510}[^ ]$") 
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

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

  /**
   * Status should be a value as follows: 0: disable; 1: enable
   * @return status
  */
  @ApiModelProperty(required = true, value = "Status should be a value as follows: 0: disable; 1: enable")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

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

  public SwitchAclConfig policy(Integer policy) {
    this.policy = policy;
    return this;
  }

  /**
   * Policy should be a value as follows: 0: drop; 1: allow;
   * @return policy
  */
  @ApiModelProperty(required = true, value = "Policy should be a value as follows: 0: drop; 1: allow;")
  @NotNull


  public Integer getPolicy() {
    return policy;
  }

  public void setPolicy(Integer policy) {
    this.policy = policy;
  }

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

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

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


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

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

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

  public SwitchAclConfig 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 SwitchAclConfig destinationIds(List<String> destinationIds) {
    this.destinationIds = destinationIds;
    return this;
  }

  public SwitchAclConfig addDestinationIdsItem(String destinationIdsItem) {
    if (this.destinationIds == null) {
      this.destinationIds = new ArrayList<>();
    }
    this.destinationIds.add(destinationIdsItem);
    return this;
  }

  /**
   * Source 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(value = "Source 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.")


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

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

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

  /**
   * SourceType should be a value as follows: 0: network; 1: IP Group; 2: IP-Port Group; 4: SSID; 6: IPv6 Group; 7: IPv6-Port Group
   * @return sourceType
  */
  @ApiModelProperty(required = true, value = "SourceType should be a value as follows: 0: network; 1: IP Group; 2: IP-Port Group; 4: SSID; 6: IPv6 Group; 7: IPv6-Port Group")
  @NotNull


  public Integer getSourceType() {
    return sourceType;
  }

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

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

  /**
   * DestinationType should be a value as follows: 0: network; 1: IP Group; 2: IP-Port Group; 6: IPv6 Group; 7: IPv6-Port Group
   * @return destinationType
  */
  @ApiModelProperty(required = true, value = "DestinationType should be a value as follows: 0: network; 1: IP Group; 2: IP-Port Group; 6: IPv6 Group; 7: IPv6-Port Group")
  @NotNull


  public Integer getDestinationType() {
    return destinationType;
  }

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

  public SwitchAclConfig bindingType(Integer bindingType) {
    this.bindingType = bindingType;
    return this;
  }

  /**
   * BindingType should be a value as follows: 0: all ports; 1: custom ports; 2: VLAN
   * @return bindingType
  */
  @ApiModelProperty(required = true, value = "BindingType should be a value as follows: 0: all ports; 1: custom ports; 2: VLAN")
  @NotNull


  public Integer getBindingType() {
    return bindingType;
  }

  public void setBindingType(Integer bindingType) {
    this.bindingType = bindingType;
  }

  public SwitchAclConfig customAclPorts(List<SwitchAclPortEntity> customAclPorts) {
    this.customAclPorts = customAclPorts;
    return this;
  }

  public SwitchAclConfig addCustomAclPortsItem(SwitchAclPortEntity customAclPortsItem) {
    if (this.customAclPorts == null) {
      this.customAclPorts = new ArrayList<>();
    }
    this.customAclPorts.add(customAclPortsItem);
    return this;
  }

  /**
   * Only for bindingType is custom ports, select the custom port or LAG of the device
   * @return customAclPorts
  */
  @ApiModelProperty(value = "Only for bindingType is custom ports, select the custom port or LAG of the device")

  @Valid

  public List<SwitchAclPortEntity> getCustomAclPorts() {
    return customAclPorts;
  }

  public void setCustomAclPorts(List<SwitchAclPortEntity> customAclPorts) {
    this.customAclPorts = customAclPorts;
  }

  public SwitchAclConfig networkId(String networkId) {
    this.networkId = networkId;
    return this;
  }

  /**
   * Only for bindingType VLAN
   * @return networkId
  */
  @ApiModelProperty(value = "Only for bindingType VLAN")


  public String getNetworkId() {
    return networkId;
  }

  public void setNetworkId(String networkId) {
    this.networkId = networkId;
  }

  public SwitchAclConfig bindingBridgeVlan(Integer bindingBridgeVlan) {
    this.bindingBridgeVlan = bindingBridgeVlan;
    return this;
  }

  /**
   * Only for bindingType VLAN and network of bridge VLAN
   * @return bindingBridgeVlan
  */
  @ApiModelProperty(value = "Only for bindingType VLAN and network of bridge VLAN")


  public Integer getBindingBridgeVlan() {
    return bindingBridgeVlan;
  }

  public void setBindingBridgeVlan(Integer bindingBridgeVlan) {
    this.bindingBridgeVlan = bindingBridgeVlan;
  }

  public SwitchAclConfig etherType(SwitchAclEtherTypeEntity etherType) {
    this.etherType = etherType;
    return this;
  }

  /**
   * Get etherType
   * @return etherType
  */
  @ApiModelProperty(required = true, value = "")
  @NotNull

  @Valid

  public SwitchAclEtherTypeEntity getEtherType() {
    return etherType;
  }

  public void setEtherType(SwitchAclEtherTypeEntity etherType) {
    this.etherType = etherType;
  }

  public SwitchAclConfig timeRangeId(String timeRangeId) {
    this.timeRangeId = timeRangeId;
    return this;
  }

  /**
   * Time range profile ID
   * @return timeRangeId
  */
  @ApiModelProperty(value = "Time range profile ID")


  public String getTimeRangeId() {
    return timeRangeId;
  }

  public void setTimeRangeId(String timeRangeId) {
    this.timeRangeId = timeRangeId;
  }

  public SwitchAclConfig biDirectional(Boolean biDirectional) {
    this.biDirectional = biDirectional;
    return this;
  }

  /**
   * Whether to enable the bidirectional, this field required only when creating a new entry
   * @return biDirectional
  */
  @ApiModelProperty(value = "Whether to enable the bidirectional, this field required only when creating a new entry")


  public Boolean getBiDirectional() {
    return biDirectional;
  }

  public void setBiDirectional(Boolean biDirectional) {
    this.biDirectional = biDirectional;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SwitchAclConfig switchAclConfig = (SwitchAclConfig) o;
    return Objects.equals(this.description, switchAclConfig.description) &&
        Objects.equals(this.status, switchAclConfig.status) &&
        Objects.equals(this.policy, switchAclConfig.policy) &&
        Objects.equals(this.protocols, switchAclConfig.protocols) &&
        Objects.equals(this.sourceIds, switchAclConfig.sourceIds) &&
        Objects.equals(this.destinationIds, switchAclConfig.destinationIds) &&
        Objects.equals(this.sourceType, switchAclConfig.sourceType) &&
        Objects.equals(this.destinationType, switchAclConfig.destinationType) &&
        Objects.equals(this.bindingType, switchAclConfig.bindingType) &&
        Objects.equals(this.customAclPorts, switchAclConfig.customAclPorts) &&
        Objects.equals(this.networkId, switchAclConfig.networkId) &&
        Objects.equals(this.bindingBridgeVlan, switchAclConfig.bindingBridgeVlan) &&
        Objects.equals(this.etherType, switchAclConfig.etherType) &&
        Objects.equals(this.timeRangeId, switchAclConfig.timeRangeId) &&
        Objects.equals(this.biDirectional, switchAclConfig.biDirectional);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, status, policy, protocols, sourceIds, destinationIds, sourceType, destinationType, bindingType, customAclPorts, networkId, bindingBridgeVlan, etherType, timeRangeId, biDirectional);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SwitchAclConfig {\n");
    
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    policy: ").append(toIndentedString(policy)).append("\n");
    sb.append("    protocols: ").append(toIndentedString(protocols)).append("\n");
    sb.append("    sourceIds: ").append(toIndentedString(sourceIds)).append("\n");
    sb.append("    destinationIds: ").append(toIndentedString(destinationIds)).append("\n");
    sb.append("    sourceType: ").append(toIndentedString(sourceType)).append("\n");
    sb.append("    destinationType: ").append(toIndentedString(destinationType)).append("\n");
    sb.append("    bindingType: ").append(toIndentedString(bindingType)).append("\n");
    sb.append("    customAclPorts: ").append(toIndentedString(customAclPorts)).append("\n");
    sb.append("    networkId: ").append(toIndentedString(networkId)).append("\n");
    sb.append("    bindingBridgeVlan: ").append(toIndentedString(bindingBridgeVlan)).append("\n");
    sb.append("    etherType: ").append(toIndentedString(etherType)).append("\n");
    sb.append("    timeRangeId: ").append(toIndentedString(timeRangeId)).append("\n");
    sb.append("    biDirectional: ").append(toIndentedString(biDirectional)).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    ");
  }
}

