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

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

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

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

public class ApnProfile   {
  @JsonProperty("apnProfileId")
  private String apnProfileId;

  @JsonProperty("name")
  private String name;

  @JsonProperty("pdpType")
  private Integer pdpType;

  @JsonProperty("apnType")
  private Integer apnType;

  @JsonProperty("apn")
  private String apn;

  @JsonProperty("username")
  private String username;

  @JsonProperty("password")
  private String password;

  @JsonProperty("authentication")
  private Integer authentication;

  @JsonProperty("buildIn")
  private Boolean buildIn;

  public ApnProfile apnProfileId(String apnProfileId) {
    this.apnProfileId = apnProfileId;
    return this;
  }

  /**
   * APN profile ID
   * @return apnProfileId
  */
  @ApiModelProperty(value = "APN profile ID")


  public String getApnProfileId() {
    return apnProfileId;
  }

  public void setApnProfileId(String apnProfileId) {
    this.apnProfileId = apnProfileId;
  }

  public ApnProfile name(String name) {
    this.name = name;
    return this;
  }

  /**
   * APN profile name, name should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "APN profile name, name should contain 1 to 64 characters.")
  @NotNull

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

  public void setName(String name) {
    this.name = name;
  }

  public ApnProfile pdpType(Integer pdpType) {
    this.pdpType = pdpType;
    return this;
  }

  /**
   * PdpType should be a value as follows: 0: IPv4; 1: IPv6; 2: IPv4 & IPv6.
   * @return pdpType
  */
  @ApiModelProperty(required = true, value = "PdpType should be a value as follows: 0: IPv4; 1: IPv6; 2: IPv4 & IPv6.")
  @NotNull


  public Integer getPdpType() {
    return pdpType;
  }

  public void setPdpType(Integer pdpType) {
    this.pdpType = pdpType;
  }

  public ApnProfile apnType(Integer apnType) {
    this.apnType = apnType;
    return this;
  }

  /**
   * ApnType should be a value as follows: 0: static; 1: dynamic.
   * @return apnType
  */
  @ApiModelProperty(required = true, value = "ApnType should be a value as follows: 0: static; 1: dynamic.")
  @NotNull


  public Integer getApnType() {
    return apnType;
  }

  public void setApnType(Integer apnType) {
    this.apnType = apnType;
  }

  public ApnProfile apn(String apn) {
    this.apn = apn;
    return this;
  }

  /**
   * Access point name, only for apnType static, should contain 1 to 64 characters and should meet the following requirements:     1. Should not start with \"rac\", \"lac\", \"sgsn\" or \"rnc\" and end with \".gprs\", ignoring case.     2. Should not contain \".*.\", \".-\", \"-.\" and spaces.     3. Should not contain any of the characters #!$%^&*(),:;\"'|\\@. 
   * @return apn
  */
  @ApiModelProperty(value = "Access point name, only for apnType static, should contain 1 to 64 characters and should meet the following requirements:     1. Should not start with \"rac\", \"lac\", \"sgsn\" or \"rnc\" and end with \".gprs\", ignoring case.     2. Should not contain \".*.\", \".-\", \"-.\" and spaces.     3. Should not contain any of the characters #!$%^&*(),:;\"'|\\@. ")

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

  public void setApn(String apn) {
    this.apn = apn;
  }

  public ApnProfile username(String username) {
    this.username = username;
    return this;
  }

  /**
   * Username should contain 1 to 64 characters, spaces, comma, single quotation marks and double quotation marks are not allowed.
   * @return username
  */
  @ApiModelProperty(value = "Username should contain 1 to 64 characters, spaces, comma, single quotation marks and double quotation marks are not allowed.")

@Pattern(regexp="^([\\041-\\053]|[\\055-\\0176]){1,64}$") 
  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public ApnProfile password(String password) {
    this.password = password;
    return this;
  }

  /**
   * Password should contain 1 to 64 characters, spaces, comma, single quotation marks and double quotation marks are not allowed.
   * @return password
  */
  @ApiModelProperty(value = "Password should contain 1 to 64 characters, spaces, comma, single quotation marks and double quotation marks are not allowed.")

@Pattern(regexp="^([\\041-\\053]|[\\055-\\0176]){1,64}$") 
  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public ApnProfile authentication(Integer authentication) {
    this.authentication = authentication;
    return this;
  }

  /**
   * Authentication should be a value as follows: 0: None; 1: PAP; 2: CHAP
   * @return authentication
  */
  @ApiModelProperty(required = true, value = "Authentication should be a value as follows: 0: None; 1: PAP; 2: CHAP")
  @NotNull


  public Integer getAuthentication() {
    return authentication;
  }

  public void setAuthentication(Integer authentication) {
    this.authentication = authentication;
  }

  public ApnProfile buildIn(Boolean buildIn) {
    this.buildIn = buildIn;
    return this;
  }

  /**
   * Indicates whether this APN profile is a built-in APN profile for SIM card.
   * @return buildIn
  */
  @ApiModelProperty(value = "Indicates whether this APN profile is a built-in APN profile for SIM card.")


  public Boolean getBuildIn() {
    return buildIn;
  }

  public void setBuildIn(Boolean buildIn) {
    this.buildIn = buildIn;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApnProfile apnProfile = (ApnProfile) o;
    return Objects.equals(this.apnProfileId, apnProfile.apnProfileId) &&
        Objects.equals(this.name, apnProfile.name) &&
        Objects.equals(this.pdpType, apnProfile.pdpType) &&
        Objects.equals(this.apnType, apnProfile.apnType) &&
        Objects.equals(this.apn, apnProfile.apn) &&
        Objects.equals(this.username, apnProfile.username) &&
        Objects.equals(this.password, apnProfile.password) &&
        Objects.equals(this.authentication, apnProfile.authentication) &&
        Objects.equals(this.buildIn, apnProfile.buildIn);
  }

  @Override
  public int hashCode() {
    return Objects.hash(apnProfileId, name, pdpType, apnType, apn, username, password, authentication, buildIn);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApnProfile {\n");
    
    sb.append("    apnProfileId: ").append(toIndentedString(apnProfileId)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    pdpType: ").append(toIndentedString(pdpType)).append("\n");
    sb.append("    apnType: ").append(toIndentedString(apnType)).append("\n");
    sb.append("    apn: ").append(toIndentedString(apn)).append("\n");
    sb.append("    username: ").append(toIndentedString(username)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    authentication: ").append(toIndentedString(authentication)).append("\n");
    sb.append("    buildIn: ").append(toIndentedString(buildIn)).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    ");
  }
}

