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

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

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

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

public class LdapSetting   {
  @JsonProperty("ldapProfileId")
  private String ldapProfileId;

  @JsonProperty("portalCustom")
  private Integer portalCustom;

  @JsonProperty("externalUrlScheme")
  private String externalUrlScheme;

  @JsonProperty("externalUrl")
  private String externalUrl;

  public LdapSetting ldapProfileId(String ldapProfileId) {
    this.ldapProfileId = ldapProfileId;
    return this;
  }

  /**
   * LDAP profile ID. Ldap profile can be  created using 'Create a new LDAP profile' ('Create a new LDAP profile template') interface, and LDAP profile ID can be obtained from 'Get LDAP profile list' ('Get LDAP profile template list') interface
   * @return ldapProfileId
  */
  @ApiModelProperty(required = true, value = "LDAP profile ID. Ldap profile can be  created using 'Create a new LDAP profile' ('Create a new LDAP profile template') interface, and LDAP profile ID can be obtained from 'Get LDAP profile list' ('Get LDAP profile template list') interface")
  @NotNull


  public String getLdapProfileId() {
    return ldapProfileId;
  }

  public void setLdapProfileId(String ldapProfileId) {
    this.ldapProfileId = ldapProfileId;
  }

  public LdapSetting portalCustom(Integer portalCustom) {
    this.portalCustom = portalCustom;
    return this;
  }

  /**
   * Portal customization, should be a value as follows: 1: use local; 2: use external
   * @return portalCustom
  */
  @ApiModelProperty(required = true, value = "Portal customization, should be a value as follows: 1: use local; 2: use external")
  @NotNull


  public Integer getPortalCustom() {
    return portalCustom;
  }

  public void setPortalCustom(Integer portalCustom) {
    this.portalCustom = portalCustom;
  }

  public LdapSetting externalUrlScheme(String externalUrlScheme) {
    this.externalUrlScheme = externalUrlScheme;
    return this;
  }

  /**
   * External URL scheme, should be a value as follows: http ; https. Required when portalCustom is 2.
   * @return externalUrlScheme
  */
  @ApiModelProperty(value = "External URL scheme, should be a value as follows: http ; https. Required when portalCustom is 2.")

@Pattern(regexp="http|https") 
  public String getExternalUrlScheme() {
    return externalUrlScheme;
  }

  public void setExternalUrlScheme(String externalUrlScheme) {
    this.externalUrlScheme = externalUrlScheme;
  }

  public LdapSetting externalUrl(String externalUrl) {
    this.externalUrl = externalUrl;
    return this;
  }

  /**
   * External URL. Required when portalCustom is 2.
   * @return externalUrl
  */
  @ApiModelProperty(value = "External URL. Required when portalCustom is 2.")

@Pattern(regexp="^(([-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,63})|(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.)){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)))((:([1-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]))?)(/([-a-zA-Z0-9@:%_+.~#?&//=]*))?$") 
  public String getExternalUrl() {
    return externalUrl;
  }

  public void setExternalUrl(String externalUrl) {
    this.externalUrl = externalUrl;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    LdapSetting ldapSetting = (LdapSetting) o;
    return Objects.equals(this.ldapProfileId, ldapSetting.ldapProfileId) &&
        Objects.equals(this.portalCustom, ldapSetting.portalCustom) &&
        Objects.equals(this.externalUrlScheme, ldapSetting.externalUrlScheme) &&
        Objects.equals(this.externalUrl, ldapSetting.externalUrl);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ldapProfileId, portalCustom, externalUrlScheme, externalUrl);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class LdapSetting {\n");
    
    sb.append("    ldapProfileId: ").append(toIndentedString(ldapProfileId)).append("\n");
    sb.append("    portalCustom: ").append(toIndentedString(portalCustom)).append("\n");
    sb.append("    externalUrlScheme: ").append(toIndentedString(externalUrlScheme)).append("\n");
    sb.append("    externalUrl: ").append(toIndentedString(externalUrl)).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    ");
  }
}

