package org.wfc.omada.api.accesscontrol.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * PortalAccessControlOpenApiVo
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-06-03T18:17:18.126730900+08:00[Asia/Shanghai]")

public class PortalAccessControlOpenApiVo   {
  @JsonProperty("preAuthAccessEnable")
  private Boolean preAuthAccessEnable;

  @JsonProperty("preAuthAccessPolicies")
  @Valid
  private List<PreAuthAccessPolicyOpenApiVo> preAuthAccessPolicies = null;

  @JsonProperty("freeAuthClientEnable")
  private Boolean freeAuthClientEnable;

  @JsonProperty("freeAuthClientPolicies")
  @Valid
  private List<FreeAuthClientPolicyOpenApiVo> freeAuthClientPolicies = null;

  public PortalAccessControlOpenApiVo preAuthAccessEnable(Boolean preAuthAccessEnable) {
    this.preAuthAccessEnable = preAuthAccessEnable;
    return this;
  }

  /**
   * Whether to enable Pre-Authentication Access. If parameter [preAuthAccessEnable] is true, parameter [preAuthAccessPolicies] is needed
   * @return preAuthAccessEnable
  */
  @ApiModelProperty(required = true, value = "Whether to enable Pre-Authentication Access. If parameter [preAuthAccessEnable] is true, parameter [preAuthAccessPolicies] is needed")
  @NotNull


  public Boolean getPreAuthAccessEnable() {
    return preAuthAccessEnable;
  }

  public void setPreAuthAccessEnable(Boolean preAuthAccessEnable) {
    this.preAuthAccessEnable = preAuthAccessEnable;
  }

  public PortalAccessControlOpenApiVo preAuthAccessPolicies(List<PreAuthAccessPolicyOpenApiVo> preAuthAccessPolicies) {
    this.preAuthAccessPolicies = preAuthAccessPolicies;
    return this;
  }

  public PortalAccessControlOpenApiVo addPreAuthAccessPoliciesItem(PreAuthAccessPolicyOpenApiVo preAuthAccessPoliciesItem) {
    if (this.preAuthAccessPolicies == null) {
      this.preAuthAccessPolicies = new ArrayList<>();
    }
    this.preAuthAccessPolicies.add(preAuthAccessPoliciesItem);
    return this;
  }

  /**
   * List of Pre-Authentication Access Policy
   * @return preAuthAccessPolicies
  */
  @ApiModelProperty(value = "List of Pre-Authentication Access Policy")

  @Valid

  public List<PreAuthAccessPolicyOpenApiVo> getPreAuthAccessPolicies() {
    return preAuthAccessPolicies;
  }

  public void setPreAuthAccessPolicies(List<PreAuthAccessPolicyOpenApiVo> preAuthAccessPolicies) {
    this.preAuthAccessPolicies = preAuthAccessPolicies;
  }

  public PortalAccessControlOpenApiVo freeAuthClientEnable(Boolean freeAuthClientEnable) {
    this.freeAuthClientEnable = freeAuthClientEnable;
    return this;
  }

  /**
   * Whether to enable Free-Authentication Client. If parameter [freeAuthClientEnable] is true, parameter [freeAuthClientPolicies] is needed
   * @return freeAuthClientEnable
  */
  @ApiModelProperty(required = true, value = "Whether to enable Free-Authentication Client. If parameter [freeAuthClientEnable] is true, parameter [freeAuthClientPolicies] is needed")
  @NotNull


  public Boolean getFreeAuthClientEnable() {
    return freeAuthClientEnable;
  }

  public void setFreeAuthClientEnable(Boolean freeAuthClientEnable) {
    this.freeAuthClientEnable = freeAuthClientEnable;
  }

  public PortalAccessControlOpenApiVo freeAuthClientPolicies(List<FreeAuthClientPolicyOpenApiVo> freeAuthClientPolicies) {
    this.freeAuthClientPolicies = freeAuthClientPolicies;
    return this;
  }

  public PortalAccessControlOpenApiVo addFreeAuthClientPoliciesItem(FreeAuthClientPolicyOpenApiVo freeAuthClientPoliciesItem) {
    if (this.freeAuthClientPolicies == null) {
      this.freeAuthClientPolicies = new ArrayList<>();
    }
    this.freeAuthClientPolicies.add(freeAuthClientPoliciesItem);
    return this;
  }

  /**
   * List of Free-Authentication Client Policy
   * @return freeAuthClientPolicies
  */
  @ApiModelProperty(value = "List of Free-Authentication Client Policy")

  @Valid

  public List<FreeAuthClientPolicyOpenApiVo> getFreeAuthClientPolicies() {
    return freeAuthClientPolicies;
  }

  public void setFreeAuthClientPolicies(List<FreeAuthClientPolicyOpenApiVo> freeAuthClientPolicies) {
    this.freeAuthClientPolicies = freeAuthClientPolicies;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PortalAccessControlOpenApiVo portalAccessControlOpenApiVo = (PortalAccessControlOpenApiVo) o;
    return Objects.equals(this.preAuthAccessEnable, portalAccessControlOpenApiVo.preAuthAccessEnable) &&
        Objects.equals(this.preAuthAccessPolicies, portalAccessControlOpenApiVo.preAuthAccessPolicies) &&
        Objects.equals(this.freeAuthClientEnable, portalAccessControlOpenApiVo.freeAuthClientEnable) &&
        Objects.equals(this.freeAuthClientPolicies, portalAccessControlOpenApiVo.freeAuthClientPolicies);
  }

  @Override
  public int hashCode() {
    return Objects.hash(preAuthAccessEnable, preAuthAccessPolicies, freeAuthClientEnable, freeAuthClientPolicies);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PortalAccessControlOpenApiVo {\n");
    
    sb.append("    preAuthAccessEnable: ").append(toIndentedString(preAuthAccessEnable)).append("\n");
    sb.append("    preAuthAccessPolicies: ").append(toIndentedString(preAuthAccessPolicies)).append("\n");
    sb.append("    freeAuthClientEnable: ").append(toIndentedString(freeAuthClientEnable)).append("\n");
    sb.append("    freeAuthClientPolicies: ").append(toIndentedString(freeAuthClientPolicies)).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    ");
  }
}

