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;

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

public class ApnProfileConfig   {
  @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;

  public ApnProfileConfig 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 ApnProfileConfig 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 ApnProfileConfig 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 ApnProfileConfig 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 ApnProfileConfig 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="^[\\x21\\x23-\\x26\\x28-\\x2B\\x2D-\\x7E]{1,64}$") 
  public String getUsername() {
    return username;
  }

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

  public ApnProfileConfig 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="^[\\x21\\x23-\\x26\\x28-\\x2B\\x2D-\\x7E]{1,64}$") 
  public String getPassword() {
    return password;
  }

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

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


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

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

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApnProfileConfig {\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("}");
    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    ");
  }
}

