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;

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

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

  @JsonProperty("index")
  private Integer index;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("description")
  private String description;

  @JsonProperty("direction")
  private Integer direction;

  @JsonProperty("policy")
  private Integer policy;

  @JsonProperty("protocol")
  private Integer protocol;

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

  @JsonProperty("sourcePort")
  private String sourcePort;

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

  @JsonProperty("destinationPort")
  private String destinationPort;

  @JsonProperty("logStatus")
  private Boolean logStatus;

  @JsonProperty("hitCounts")
  private Integer hitCounts;

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

  /**
   * Custom ACL ID
   * @return id
  */
  @ApiModelProperty(required = true, value = "Custom ACL ID")
  @NotNull


  public String getId() {
    return id;
  }

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

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

  /**
   * Custom ACL index
   * @return index
  */
  @ApiModelProperty(required = true, value = "Custom ACL index")
  @NotNull


  public Integer getIndex() {
    return index;
  }

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

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

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


  public Boolean getStatus() {
    return status;
  }

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

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

  /**
   * Custom ACL description should contain 1 to 512 characters.
   * @return description
  */
  @ApiModelProperty(required = true, value = "Custom ACL 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 GatewayCustomAclInfoEntity direction(Integer direction) {
    this.direction = direction;
    return this;
  }

  /**
   * Custom ACL direction should be a value as follows: 0: LAN-LAN; 1: LAN-WAN; 2: WAN-LAN; 3: LOCAL IN
   * @return direction
  */
  @ApiModelProperty(required = true, value = "Custom ACL direction should be a value as follows: 0: LAN-LAN; 1: LAN-WAN; 2: WAN-LAN; 3: LOCAL IN")
  @NotNull


  public Integer getDirection() {
    return direction;
  }

  public void setDirection(Integer direction) {
    this.direction = direction;
  }

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

  /**
   * Custom ACL policy should be a value as follows: 0: Drop; 1:Allow
   * @return policy
  */
  @ApiModelProperty(required = true, value = "Custom ACL 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 GatewayCustomAclInfoEntity protocol(Integer protocol) {
    this.protocol = protocol;
    return this;
  }

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


  public Integer getProtocol() {
    return protocol;
  }

  public void setProtocol(Integer protocol) {
    this.protocol = protocol;
  }

  public GatewayCustomAclInfoEntity sourceList(List<String> sourceList) {
    this.sourceList = sourceList;
    return this;
  }

  public GatewayCustomAclInfoEntity addSourceListItem(String sourceListItem) {
    this.sourceList.add(sourceListItem);
    return this;
  }

  /**
   * Custom ACL source list.
   * @return sourceList
  */
  @ApiModelProperty(required = true, value = "Custom ACL source list.")
  @NotNull


  public List<String> getSourceList() {
    return sourceList;
  }

  public void setSourceList(List<String> sourceList) {
    this.sourceList = sourceList;
  }

  public GatewayCustomAclInfoEntity sourcePort(String sourcePort) {
    this.sourcePort = sourcePort;
    return this;
  }

  /**
   * Custom ACL source port. when \"protocol\" is \"TCP\" or \"UDP\", port is valid.
   * @return sourcePort
  */
  @ApiModelProperty(value = "Custom ACL source port. when \"protocol\" is \"TCP\" or \"UDP\", port is valid.")


  public String getSourcePort() {
    return sourcePort;
  }

  public void setSourcePort(String sourcePort) {
    this.sourcePort = sourcePort;
  }

  public GatewayCustomAclInfoEntity destinationList(List<String> destinationList) {
    this.destinationList = destinationList;
    return this;
  }

  public GatewayCustomAclInfoEntity addDestinationListItem(String destinationListItem) {
    this.destinationList.add(destinationListItem);
    return this;
  }

  /**
   * Custom ACL destination list.
   * @return destinationList
  */
  @ApiModelProperty(required = true, value = "Custom ACL destination list.")
  @NotNull


  public List<String> getDestinationList() {
    return destinationList;
  }

  public void setDestinationList(List<String> destinationList) {
    this.destinationList = destinationList;
  }

  public GatewayCustomAclInfoEntity destinationPort(String destinationPort) {
    this.destinationPort = destinationPort;
    return this;
  }

  /**
   * Custom ACL destination port. when \"protocol\" is \"TCP\" or \"UDP\", port is valid.
   * @return destinationPort
  */
  @ApiModelProperty(value = "Custom ACL destination port. when \"protocol\" is \"TCP\" or \"UDP\", port is valid.")


  public String getDestinationPort() {
    return destinationPort;
  }

  public void setDestinationPort(String destinationPort) {
    this.destinationPort = destinationPort;
  }

  public GatewayCustomAclInfoEntity logStatus(Boolean logStatus) {
    this.logStatus = logStatus;
    return this;
  }

  /**
   * Custom ACL log status
   * @return logStatus
  */
  @ApiModelProperty(required = true, value = "Custom ACL log status")
  @NotNull


  public Boolean getLogStatus() {
    return logStatus;
  }

  public void setLogStatus(Boolean logStatus) {
    this.logStatus = logStatus;
  }

  public GatewayCustomAclInfoEntity hitCounts(Integer hitCounts) {
    this.hitCounts = hitCounts;
    return this;
  }

  /**
   * Show custom ACL hit counts.
   * @return hitCounts
  */
  @ApiModelProperty(value = "Show custom ACL hit counts.")


  public Integer getHitCounts() {
    return hitCounts;
  }

  public void setHitCounts(Integer hitCounts) {
    this.hitCounts = hitCounts;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GatewayCustomAclInfoEntity gatewayCustomAclInfoEntity = (GatewayCustomAclInfoEntity) o;
    return Objects.equals(this.id, gatewayCustomAclInfoEntity.id) &&
        Objects.equals(this.index, gatewayCustomAclInfoEntity.index) &&
        Objects.equals(this.status, gatewayCustomAclInfoEntity.status) &&
        Objects.equals(this.description, gatewayCustomAclInfoEntity.description) &&
        Objects.equals(this.direction, gatewayCustomAclInfoEntity.direction) &&
        Objects.equals(this.policy, gatewayCustomAclInfoEntity.policy) &&
        Objects.equals(this.protocol, gatewayCustomAclInfoEntity.protocol) &&
        Objects.equals(this.sourceList, gatewayCustomAclInfoEntity.sourceList) &&
        Objects.equals(this.sourcePort, gatewayCustomAclInfoEntity.sourcePort) &&
        Objects.equals(this.destinationList, gatewayCustomAclInfoEntity.destinationList) &&
        Objects.equals(this.destinationPort, gatewayCustomAclInfoEntity.destinationPort) &&
        Objects.equals(this.logStatus, gatewayCustomAclInfoEntity.logStatus) &&
        Objects.equals(this.hitCounts, gatewayCustomAclInfoEntity.hitCounts);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, index, status, description, direction, policy, protocol, sourceList, sourcePort, destinationList, destinationPort, logStatus, hitCounts);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GatewayCustomAclInfoEntity {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    index: ").append(toIndentedString(index)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    direction: ").append(toIndentedString(direction)).append("\n");
    sb.append("    policy: ").append(toIndentedString(policy)).append("\n");
    sb.append("    protocol: ").append(toIndentedString(protocol)).append("\n");
    sb.append("    sourceList: ").append(toIndentedString(sourceList)).append("\n");
    sb.append("    sourcePort: ").append(toIndentedString(sourcePort)).append("\n");
    sb.append("    destinationList: ").append(toIndentedString(destinationList)).append("\n");
    sb.append("    destinationPort: ").append(toIndentedString(destinationPort)).append("\n");
    sb.append("    logStatus: ").append(toIndentedString(logStatus)).append("\n");
    sb.append("    hitCounts: ").append(toIndentedString(hitCounts)).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    ");
  }
}

