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

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

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

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

  @JsonProperty("status")
  private Boolean status;

  @JsonProperty("interfaceId")
  private String interfaceId;

  @JsonProperty("publicKey")
  private String publicKey;

  @JsonProperty("endPoint")
  private String endPoint;

  @JsonProperty("endPointPort")
  private Integer endPointPort;

  @JsonProperty("allowAddress")
  @Valid
  private List<String> allowAddress = new ArrayList<>();

  @JsonProperty("presharedKey")
  private String presharedKey;

  @JsonProperty("keepAlive")
  private Integer keepAlive;

  @JsonProperty("comment")
  private String comment;

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

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

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


  public Boolean getStatus() {
    return status;
  }

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

  public WireguardPeerOpenApiVo interfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
    return this;
  }

  /**
   * The ID of WireGuard VPN to which this WireGuard peer binds. The ID can be obtained from 'Get all wireguard's id and name info' interface.
   * @return interfaceId
  */
  @ApiModelProperty(required = true, value = "The ID of WireGuard VPN to which this WireGuard peer binds. The ID can be obtained from 'Get all wireguard's id and name info' interface.")
  @NotNull


  public String getInterfaceId() {
    return interfaceId;
  }

  public void setInterfaceId(String interfaceId) {
    this.interfaceId = interfaceId;
  }

  public WireguardPeerOpenApiVo publicKey(String publicKey) {
    this.publicKey = publicKey;
    return this;
  }

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

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

  public void setPublicKey(String publicKey) {
    this.publicKey = publicKey;
  }

  public WireguardPeerOpenApiVo endPoint(String endPoint) {
    this.endPoint = endPoint;
    return this;
  }

  /**
   * The end point IP of WireGuard peer.
   * @return endPoint
  */
  @ApiModelProperty(value = "The end point IP of WireGuard peer.")


  public String getEndPoint() {
    return endPoint;
  }

  public void setEndPoint(String endPoint) {
    this.endPoint = endPoint;
  }

  public WireguardPeerOpenApiVo endPointPort(Integer endPointPort) {
    this.endPointPort = endPointPort;
    return this;
  }

  /**
   * The end point port of WireGuard peer should be within the range of 1-65535.
   * @return endPointPort
  */
  @ApiModelProperty(value = "The end point port of WireGuard peer should be within the range of 1-65535.")


  public Integer getEndPointPort() {
    return endPointPort;
  }

  public void setEndPointPort(Integer endPointPort) {
    this.endPointPort = endPointPort;
  }

  public WireguardPeerOpenApiVo allowAddress(List<String> allowAddress) {
    this.allowAddress = allowAddress;
    return this;
  }

  public WireguardPeerOpenApiVo addAllowAddressItem(String allowAddressItem) {
    this.allowAddress.add(allowAddressItem);
    return this;
  }

  /**
   * IP/MASK address list of WireGuard peer allowed.
   * @return allowAddress
  */
  @ApiModelProperty(required = true, value = "IP/MASK address list of WireGuard peer allowed.")
  @NotNull


  public List<String> getAllowAddress() {
    return allowAddress;
  }

  public void setAllowAddress(List<String> allowAddress) {
    this.allowAddress = allowAddress;
  }

  public WireguardPeerOpenApiVo presharedKey(String presharedKey) {
    this.presharedKey = presharedKey;
    return this;
  }

  /**
   * The presharedKey of WireGuard peer must have 44 character of base64 and end with '='.
   * @return presharedKey
  */
  @ApiModelProperty(value = "The presharedKey of WireGuard peer must have 44 character of base64 and end with '='.")

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

  public void setPresharedKey(String presharedKey) {
    this.presharedKey = presharedKey;
  }

  public WireguardPeerOpenApiVo keepAlive(Integer keepAlive) {
    this.keepAlive = keepAlive;
    return this;
  }

  /**
   * The keepalive second of WireGuard peer should be within the range of 0-65535.
   * @return keepAlive
  */
  @ApiModelProperty(required = true, value = "The keepalive second of WireGuard peer should be within the range of 0-65535.")
  @NotNull


  public Integer getKeepAlive() {
    return keepAlive;
  }

  public void setKeepAlive(Integer keepAlive) {
    this.keepAlive = keepAlive;
  }

  public WireguardPeerOpenApiVo comment(String comment) {
    this.comment = comment;
    return this;
  }

  /**
   * The comment of WireGuard peer should contain 0 to 128 characters.
   * @return comment
  */
  @ApiModelProperty(value = "The comment of WireGuard peer should contain 0 to 128 characters.")

@Pattern(regexp="^$|^[^ ]$|^[^ ].{0,126}[^ ]$") 
  public String getComment() {
    return comment;
  }

  public void setComment(String comment) {
    this.comment = comment;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WireguardPeerOpenApiVo wireguardPeerOpenApiVo = (WireguardPeerOpenApiVo) o;
    return Objects.equals(this.name, wireguardPeerOpenApiVo.name) &&
        Objects.equals(this.status, wireguardPeerOpenApiVo.status) &&
        Objects.equals(this.interfaceId, wireguardPeerOpenApiVo.interfaceId) &&
        Objects.equals(this.publicKey, wireguardPeerOpenApiVo.publicKey) &&
        Objects.equals(this.endPoint, wireguardPeerOpenApiVo.endPoint) &&
        Objects.equals(this.endPointPort, wireguardPeerOpenApiVo.endPointPort) &&
        Objects.equals(this.allowAddress, wireguardPeerOpenApiVo.allowAddress) &&
        Objects.equals(this.presharedKey, wireguardPeerOpenApiVo.presharedKey) &&
        Objects.equals(this.keepAlive, wireguardPeerOpenApiVo.keepAlive) &&
        Objects.equals(this.comment, wireguardPeerOpenApiVo.comment);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, status, interfaceId, publicKey, endPoint, endPointPort, allowAddress, presharedKey, keepAlive, comment);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WireguardPeerOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    interfaceId: ").append(toIndentedString(interfaceId)).append("\n");
    sb.append("    publicKey: ").append(toIndentedString(publicKey)).append("\n");
    sb.append("    endPoint: ").append(toIndentedString(endPoint)).append("\n");
    sb.append("    endPointPort: ").append(toIndentedString(endPointPort)).append("\n");
    sb.append("    allowAddress: ").append(toIndentedString(allowAddress)).append("\n");
    sb.append("    presharedKey: ").append(toIndentedString(presharedKey)).append("\n");
    sb.append("    keepAlive: ").append(toIndentedString(keepAlive)).append("\n");
    sb.append("    comment: ").append(toIndentedString(comment)).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    ");
  }
}

