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;

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

public class ExternalRadiusSetting   {
  @JsonProperty("radiusProfileId")
  private String radiusProfileId;

  @JsonProperty("authMode")
  private Integer authMode;

  @JsonProperty("nasId")
  private String nasId;

  @JsonProperty("portalCustom")
  private Integer portalCustom;

  @JsonProperty("externalUrlScheme")
  private String externalUrlScheme;

  @JsonProperty("externalUrl")
  private String externalUrl;

  @JsonProperty("disconnectReq")
  private Boolean disconnectReq;

  @JsonProperty("receiverPort")
  private Integer receiverPort;

  public ExternalRadiusSetting radiusProfileId(String radiusProfileId) {
    this.radiusProfileId = radiusProfileId;
    return this;
  }

  /**
   * RADIUS profile ID.
   * @return radiusProfileId
  */
  @ApiModelProperty(required = true, value = "RADIUS profile ID.")
  @NotNull


  public String getRadiusProfileId() {
    return radiusProfileId;
  }

  public void setRadiusProfileId(String radiusProfileId) {
    this.radiusProfileId = radiusProfileId;
  }

  public ExternalRadiusSetting authMode(Integer authMode) {
    this.authMode = authMode;
    return this;
  }

  /**
   * RADIUS auth mode, should be a value as follows: 1: PAP; 2: CHAP
   * @return authMode
  */
  @ApiModelProperty(required = true, value = "RADIUS auth mode, should be a value as follows: 1: PAP; 2: CHAP")
  @NotNull


  public Integer getAuthMode() {
    return authMode;
  }

  public void setAuthMode(Integer authMode) {
    this.authMode = authMode;
  }

  public ExternalRadiusSetting nasId(String nasId) {
    this.nasId = nasId;
    return this;
  }

  /**
   * RADIUS Attribute: NasID, should contain 1 to 64 characters.
   * @return nasId
  */
  @ApiModelProperty(required = true, value = "RADIUS Attribute: NasID, should contain 1 to 64 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,62}[^ ]$") 
  public String getNasId() {
    return nasId;
  }

  public void setNasId(String nasId) {
    this.nasId = nasId;
  }

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

  /**
   * Portal customization, should be a value as follows: 1: Local Web Portal; 2: External Web Portal.
   * @return portalCustom
  */
  @ApiModelProperty(required = true, value = "Portal customization, should be a value as follows: 1: Local Web Portal; 2: External Web Portal.")
  @NotNull


  public Integer getPortalCustom() {
    return portalCustom;
  }

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

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

  /**
   * External URL scheme, required when [portalCustom] is 2, value could be 'http' or 'https'.
   * @return externalUrlScheme
  */
  @ApiModelProperty(value = "External URL scheme, required when [portalCustom] is 2, value could be 'http' or 'https'.")

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

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

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

  public ExternalRadiusSetting disconnectReq(Boolean disconnectReq) {
    this.disconnectReq = disconnectReq;
    return this;
  }

  /**
   * Whether to support disconnect messages.
   * @return disconnectReq
  */
  @ApiModelProperty(value = "Whether to support disconnect messages.")


  public Boolean getDisconnectReq() {
    return disconnectReq;
  }

  public void setDisconnectReq(Boolean disconnectReq) {
    this.disconnectReq = disconnectReq;
  }

  public ExternalRadiusSetting receiverPort(Integer receiverPort) {
    this.receiverPort = receiverPort;
    return this;
  }

  /**
   * Port for listening to disconnect messages, should be within the range of 1–65535.
   * @return receiverPort
  */
  @ApiModelProperty(value = "Port for listening to disconnect messages, should be within the range of 1–65535.")


  public Integer getReceiverPort() {
    return receiverPort;
  }

  public void setReceiverPort(Integer receiverPort) {
    this.receiverPort = receiverPort;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ExternalRadiusSetting externalRadiusSetting = (ExternalRadiusSetting) o;
    return Objects.equals(this.radiusProfileId, externalRadiusSetting.radiusProfileId) &&
        Objects.equals(this.authMode, externalRadiusSetting.authMode) &&
        Objects.equals(this.nasId, externalRadiusSetting.nasId) &&
        Objects.equals(this.portalCustom, externalRadiusSetting.portalCustom) &&
        Objects.equals(this.externalUrlScheme, externalRadiusSetting.externalUrlScheme) &&
        Objects.equals(this.externalUrl, externalRadiusSetting.externalUrl) &&
        Objects.equals(this.disconnectReq, externalRadiusSetting.disconnectReq) &&
        Objects.equals(this.receiverPort, externalRadiusSetting.receiverPort);
  }

  @Override
  public int hashCode() {
    return Objects.hash(radiusProfileId, authMode, nasId, portalCustom, externalUrlScheme, externalUrl, disconnectReq, receiverPort);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ExternalRadiusSetting {\n");
    
    sb.append("    radiusProfileId: ").append(toIndentedString(radiusProfileId)).append("\n");
    sb.append("    authMode: ").append(toIndentedString(authMode)).append("\n");
    sb.append("    nasId: ").append(toIndentedString(nasId)).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("    disconnectReq: ").append(toIndentedString(disconnectReq)).append("\n");
    sb.append("    receiverPort: ").append(toIndentedString(receiverPort)).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    ");
  }
}

