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.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

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

public class SmsSetting   {
  @JsonProperty("sid")
  private String sid;

  @JsonProperty("authToken")
  private String authToken;

  @JsonProperty("phoneNum")
  private String phoneNum;

  @JsonProperty("userLimitEnable")
  private Boolean userLimitEnable;

  @JsonProperty("userLimit")
  private Integer userLimit;

  @JsonProperty("authTimeout")
  private AuthTimeoutSetting authTimeout;

  @JsonProperty("countryCode")
  private String countryCode;

  public SmsSetting sid(String sid) {
    this.sid = sid;
    return this;
  }

  /**
   * Twilio SID
   * @return sid
  */
  @ApiModelProperty(required = true, value = "Twilio SID")
  @NotNull


  public String getSid() {
    return sid;
  }

  public void setSid(String sid) {
    this.sid = sid;
  }

  public SmsSetting authToken(String authToken) {
    this.authToken = authToken;
    return this;
  }

  /**
   * Twilio auth token
   * @return authToken
  */
  @ApiModelProperty(required = true, value = "Twilio auth token")
  @NotNull


  public String getAuthToken() {
    return authToken;
  }

  public void setAuthToken(String authToken) {
    this.authToken = authToken;
  }

  public SmsSetting phoneNum(String phoneNum) {
    this.phoneNum = phoneNum;
    return this;
  }

  /**
   * Twilio phone number. String value, should contain at least 6 digits such as \"+123456\".
   * @return phoneNum
  */
  @ApiModelProperty(required = true, value = "Twilio phone number. String value, should contain at least 6 digits such as \"+123456\".")
  @NotNull

@Pattern(regexp="\\+\\d{6,}") 
  public String getPhoneNum() {
    return phoneNum;
  }

  public void setPhoneNum(String phoneNum) {
    this.phoneNum = phoneNum;
  }

  public SmsSetting userLimitEnable(Boolean userLimitEnable) {
    this.userLimitEnable = userLimitEnable;
    return this;
  }

  /**
   * Whether to control the limit of authentication for the same phone number.
   * @return userLimitEnable
  */
  @ApiModelProperty(required = true, value = "Whether to control the limit of authentication for the same phone number.")
  @NotNull


  public Boolean getUserLimitEnable() {
    return userLimitEnable;
  }

  public void setUserLimitEnable(Boolean userLimitEnable) {
    this.userLimitEnable = userLimitEnable;
  }

  public SmsSetting userLimit(Integer userLimit) {
    this.userLimit = userLimit;
    return this;
  }

  /**
   * User limit with the same phone number, should be within the range of 1–10. Required when parameter [userLimitEnable] is true.
   * @return userLimit
  */
  @ApiModelProperty(value = "User limit with the same phone number, should be within the range of 1–10. Required when parameter [userLimitEnable] is true.")


  public Integer getUserLimit() {
    return userLimit;
  }

  public void setUserLimit(Integer userLimit) {
    this.userLimit = userLimit;
  }

  public SmsSetting authTimeout(AuthTimeoutSetting authTimeout) {
    this.authTimeout = authTimeout;
    return this;
  }

  /**
   * Get authTimeout
   * @return authTimeout
  */
  @ApiModelProperty(required = true, value = "")
  @NotNull

  @Valid

  public AuthTimeoutSetting getAuthTimeout() {
    return authTimeout;
  }

  public void setAuthTimeout(AuthTimeoutSetting authTimeout) {
    this.authTimeout = authTimeout;
  }

  public SmsSetting countryCode(String countryCode) {
    this.countryCode = countryCode;
    return this;
  }

  /**
   * Preset Contry code. String value such as \"+86\".
   * @return countryCode
  */
  @ApiModelProperty(value = "Preset Contry code. String value such as \"+86\".")

@Pattern(regexp="^$|^\\+(93|374|994|973|880|975|673|855|86|670|995|852|91|62|98|964|972|81|962|850|82|965|996|856|961|853|60|960|976|95|977|968|92|970|63|974|7|966|65|94|963|886|992|66|90|90|993|971|998|84|967|355|376|43|375|32|387|359|3491|385|357|420|45|372|298|358|33|49|350|30|36|354|353|39|371|423|370|352|389|356|373|377|382|31|47|48|351|40|378|381|421|386|34|46|41|380|44|379|213|244|229|267|226|257|237|3491|238|236|235|269|242|243|253|20|240|291|251|241|220|233|224|245|225|254|266|231|218|261|265|223|222|230|212|258|264|227|234|262|250|239|221|248|232|252|27|211|34|249|268|255|228|216|256|260|263|1684|61|682|679|689|1671|692|691|687|64|1670|680|675|685|677|676|688|678|1684|1264|1268|297|247|1|1246|501|1441|1|1345|506|53|1767|1809|1809201|503|299|1473|590|1671|502|509|504|1876|596|52|1664|599|505|1670|507|1787|1869|1758|508|1784|1868|1649|1|1284|1340|54|591|55|56|57|593|500|594|592|595|51|597|598|58|383)$") 
  public String getCountryCode() {
    return countryCode;
  }

  public void setCountryCode(String countryCode) {
    this.countryCode = countryCode;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SmsSetting smsSetting = (SmsSetting) o;
    return Objects.equals(this.sid, smsSetting.sid) &&
        Objects.equals(this.authToken, smsSetting.authToken) &&
        Objects.equals(this.phoneNum, smsSetting.phoneNum) &&
        Objects.equals(this.userLimitEnable, smsSetting.userLimitEnable) &&
        Objects.equals(this.userLimit, smsSetting.userLimit) &&
        Objects.equals(this.authTimeout, smsSetting.authTimeout) &&
        Objects.equals(this.countryCode, smsSetting.countryCode);
  }

  @Override
  public int hashCode() {
    return Objects.hash(sid, authToken, phoneNum, userLimitEnable, userLimit, authTimeout, countryCode);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SmsSetting {\n");
    
    sb.append("    sid: ").append(toIndentedString(sid)).append("\n");
    sb.append("    authToken: ").append(toIndentedString(authToken)).append("\n");
    sb.append("    phoneNum: ").append(toIndentedString(phoneNum)).append("\n");
    sb.append("    userLimitEnable: ").append(toIndentedString(userLimitEnable)).append("\n");
    sb.append("    userLimit: ").append(toIndentedString(userLimit)).append("\n");
    sb.append("    authTimeout: ").append(toIndentedString(authTimeout)).append("\n");
    sb.append("    countryCode: ").append(toIndentedString(countryCode)).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    ");
  }
}

