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;

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

public class EapAclConfig   {
  @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;

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

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

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

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


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    EapAclConfig eapAclConfig = (EapAclConfig) o;
    return Objects.equals(this.description, eapAclConfig.description) &&
        Objects.equals(this.status, eapAclConfig.status) &&
        Objects.equals(this.policy, eapAclConfig.policy) &&
        Objects.equals(this.protocols, eapAclConfig.protocols) &&
        Objects.equals(this.sourceIds, eapAclConfig.sourceIds) &&
        Objects.equals(this.destinationIds, eapAclConfig.destinationIds) &&
        Objects.equals(this.sourceType, eapAclConfig.sourceType) &&
        Objects.equals(this.destinationType, eapAclConfig.destinationType);
  }

  @Override
  public int hashCode() {
    return Objects.hash(description, status, policy, protocols, sourceIds, destinationIds, sourceType, destinationType);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class EapAclConfig {\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("}");
    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    ");
  }
}

