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;

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

public class WireguardOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("mtu")
  private Integer mtu;

  @JsonProperty("listenPort")
  private Integer listenPort;

  @JsonProperty("privateKey")
  private String privateKey;

  @JsonProperty("localIp")
  private String localIp;

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

  /**
   * The name of WireGuard VPN should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "The name of WireGuard VPN 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 WireguardOpenApiVo status(Boolean status) {
    this.status = status;
    return this;
  }

  /**
   * The status of WireGuard VPN. Valid value is true or false.
   * @return status
  */
  @ApiModelProperty(required = true, value = "The status of WireGuard VPN. Valid value is true or false.")
  @NotNull


  public Boolean getStatus() {
    return status;
  }

  public void setStatus(Boolean status) {
    this.status = status;
  }

  public WireguardOpenApiVo mtu(Integer mtu) {
    this.mtu = mtu;
    return this;
  }

  /**
   * The MTU of WireGuard VPN should be within the range of 576-1440.
   * @return mtu
  */
  @ApiModelProperty(required = true, value = "The MTU of WireGuard VPN should be within the range of 576-1440.")
  @NotNull


  public Integer getMtu() {
    return mtu;
  }

  public void setMtu(Integer mtu) {
    this.mtu = mtu;
  }

  public WireguardOpenApiVo listenPort(Integer listenPort) {
    this.listenPort = listenPort;
    return this;
  }

  /**
   * The listening port for WireGuard VPN should be within the range of 1-65535.
   * @return listenPort
  */
  @ApiModelProperty(required = true, value = "The listening port for WireGuard VPN should be within the range of 1-65535.")
  @NotNull


  public Integer getListenPort() {
    return listenPort;
  }

  public void setListenPort(Integer listenPort) {
    this.listenPort = listenPort;
  }

  public WireguardOpenApiVo privateKey(String privateKey) {
    this.privateKey = privateKey;
    return this;
  }

  /**
   * The private key of WireGuard VPN must have 44 character of base64 and end with '='.
   * @return privateKey
  */
  @ApiModelProperty(required = true, value = "The private key of WireGuard VPN must have 44 character of base64 and end with '='.")
  @NotNull

@Pattern(regexp="^[0-9a-zA-Z+/]{43}=$") 
  public String getPrivateKey() {
    return privateKey;
  }

  public void setPrivateKey(String privateKey) {
    this.privateKey = privateKey;
  }

  public WireguardOpenApiVo localIp(String localIp) {
    this.localIp = localIp;
    return this;
  }

  /**
   * The local IP address of WireGuard VPN.
   * @return localIp
  */
  @ApiModelProperty(required = true, value = "The local IP address of WireGuard VPN.")
  @NotNull

@Pattern(regexp="\\b((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\.((?!\\d\\d\\d)\\d+|1\\d\\d|2[0-4]\\d|25[0-5])\\b") 
  public String getLocalIp() {
    return localIp;
  }

  public void setLocalIp(String localIp) {
    this.localIp = localIp;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WireguardOpenApiVo wireguardOpenApiVo = (WireguardOpenApiVo) o;
    return Objects.equals(this.name, wireguardOpenApiVo.name) &&
        Objects.equals(this.status, wireguardOpenApiVo.status) &&
        Objects.equals(this.mtu, wireguardOpenApiVo.mtu) &&
        Objects.equals(this.listenPort, wireguardOpenApiVo.listenPort) &&
        Objects.equals(this.privateKey, wireguardOpenApiVo.privateKey) &&
        Objects.equals(this.localIp, wireguardOpenApiVo.localIp);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, status, mtu, listenPort, privateKey, localIp);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WireguardOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    mtu: ").append(toIndentedString(mtu)).append("\n");
    sb.append("    listenPort: ").append(toIndentedString(listenPort)).append("\n");
    sb.append("    privateKey: ").append(toIndentedString(privateKey)).append("\n");
    sb.append("    localIp: ").append(toIndentedString(localIp)).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    ");
  }
}

