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;

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

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

  @JsonProperty("index")
  private Integer index;

  @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 = new ArrayList<>();

  @JsonProperty("syslog")
  private Boolean syslog;

  @JsonProperty("sourceType")
  private Integer sourceType;

  @JsonProperty("destinationType")
  private Integer destinationType;

  @JsonProperty("direction")
  private GatewayDirectionEntity direction;

  @JsonProperty("stateMode")
  private Integer stateMode;

  @JsonProperty("states")
  private GatewayAclStatesEntity states;

  @JsonProperty("timeRangeId")
  private String timeRangeId;

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

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


  public String getId() {
    return id;
  }

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

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

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


  public Integer getIndex() {
    return index;
  }

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

  public GatewayAclInfo 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 GatewayAclInfo 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 GatewayAclInfo 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 GatewayAclInfo protocols(List<Integer> protocols) {
    this.protocols = protocols;
    return this;
  }

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

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

  public GatewayAclInfo 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;
  }

  public GatewayAclInfo syslog(Boolean syslog) {
    this.syslog = syslog;
    return this;
  }

  /**
   * Enable remote log
   * @return syslog
  */
  @ApiModelProperty(required = true, value = "Enable remote log")
  @NotNull


  public Boolean getSyslog() {
    return syslog;
  }

  public void setSyslog(Boolean syslog) {
    this.syslog = syslog;
  }

  public GatewayAclInfo 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; 8: Country; 9: Country 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; 8: Country; 9: Country Group")
  @NotNull


  public Integer getSourceType() {
    return sourceType;
  }

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

  public GatewayAclInfo 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;10: Domain 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;10: Domain Group.")
  @NotNull


  public Integer getDestinationType() {
    return destinationType;
  }

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

  public GatewayAclInfo direction(GatewayDirectionEntity direction) {
    this.direction = direction;
    return this;
  }

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

  @Valid

  public GatewayDirectionEntity getDirection() {
    return direction;
  }

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

  public GatewayAclInfo stateMode(Integer stateMode) {
    this.stateMode = stateMode;
    return this;
  }

  /**
   * StateMode should be a value as follows: 0: auto; 1: manual
   * @return stateMode
  */
  @ApiModelProperty(required = true, value = "StateMode should be a value as follows: 0: auto; 1: manual")
  @NotNull


  public Integer getStateMode() {
    return stateMode;
  }

  public void setStateMode(Integer stateMode) {
    this.stateMode = stateMode;
  }

  public GatewayAclInfo states(GatewayAclStatesEntity states) {
    this.states = states;
    return this;
  }

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

  @Valid

  public GatewayAclStatesEntity getStates() {
    return states;
  }

  public void setStates(GatewayAclStatesEntity states) {
    this.states = states;
  }

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

  /**
   * Gateway ACL time range ID.
   * @return timeRangeId
  */
  @ApiModelProperty(value = "Gateway ACL time range ID.")


  public String getTimeRangeId() {
    return timeRangeId;
  }

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


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GatewayAclInfo gatewayAclInfo = (GatewayAclInfo) o;
    return Objects.equals(this.id, gatewayAclInfo.id) &&
        Objects.equals(this.index, gatewayAclInfo.index) &&
        Objects.equals(this.description, gatewayAclInfo.description) &&
        Objects.equals(this.status, gatewayAclInfo.status) &&
        Objects.equals(this.policy, gatewayAclInfo.policy) &&
        Objects.equals(this.protocols, gatewayAclInfo.protocols) &&
        Objects.equals(this.sourceIds, gatewayAclInfo.sourceIds) &&
        Objects.equals(this.destinationIds, gatewayAclInfo.destinationIds) &&
        Objects.equals(this.syslog, gatewayAclInfo.syslog) &&
        Objects.equals(this.sourceType, gatewayAclInfo.sourceType) &&
        Objects.equals(this.destinationType, gatewayAclInfo.destinationType) &&
        Objects.equals(this.direction, gatewayAclInfo.direction) &&
        Objects.equals(this.stateMode, gatewayAclInfo.stateMode) &&
        Objects.equals(this.states, gatewayAclInfo.states) &&
        Objects.equals(this.timeRangeId, gatewayAclInfo.timeRangeId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, index, description, status, policy, protocols, sourceIds, destinationIds, syslog, sourceType, destinationType, direction, stateMode, states, timeRangeId);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GatewayAclInfo {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    index: ").append(toIndentedString(index)).append("\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("    syslog: ").append(toIndentedString(syslog)).append("\n");
    sb.append("    sourceType: ").append(toIndentedString(sourceType)).append("\n");
    sb.append("    destinationType: ").append(toIndentedString(destinationType)).append("\n");
    sb.append("    direction: ").append(toIndentedString(direction)).append("\n");
    sb.append("    stateMode: ").append(toIndentedString(stateMode)).append("\n");
    sb.append("    states: ").append(toIndentedString(states)).append("\n");
    sb.append("    timeRangeId: ").append(toIndentedString(timeRangeId)).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    ");
  }
}

