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 java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class VpnUserRequest   {
  @JsonProperty("username")
  private String username;

  @JsonProperty("password")
  private String password;

  @JsonProperty("protocol")
  private Integer protocol;

  @JsonProperty("clientMode")
  private Integer clientMode;

  @JsonProperty("maxConnections")
  private Integer maxConnections;

  @JsonProperty("userRemoteSubnets")
  @Valid
  private List<IpSubnetsVo> userRemoteSubnets = null;

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

  @JsonProperty("localIp")
  private String localIp;

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

  /**
   * Username of the VPN user.
   * @return username
  */
  @ApiModelProperty(required = true, value = "Username of the VPN user.")
  @NotNull


  public String getUsername() {
    return username;
  }

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

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

  /**
   * Password of the VPN user.
   * @return password
  */
  @ApiModelProperty(required = true, value = "Password of the VPN user.")
  @NotNull


  public String getPassword() {
    return password;
  }

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

  public VpnUserRequest protocol(Integer protocol) {
    this.protocol = protocol;
    return this;
  }

  /**
   * Protocol should be a value as follows: 0: L2TP or PPTP; 1: openVPN.
   * @return protocol
  */
  @ApiModelProperty(value = "Protocol should be a value as follows: 0: L2TP or PPTP; 1: openVPN.")


  public Integer getProtocol() {
    return protocol;
  }

  public void setProtocol(Integer protocol) {
    this.protocol = protocol;
  }

  public VpnUserRequest clientMode(Integer clientMode) {
    this.clientMode = clientMode;
    return this;
  }

  /**
   * Client mode should be a value as follows: 0: Client-To-Site, 1: Site-To-Site.
   * @return clientMode
  */
  @ApiModelProperty(value = "Client mode should be a value as follows: 0: Client-To-Site, 1: Site-To-Site.")


  public Integer getClientMode() {
    return clientMode;
  }

  public void setClientMode(Integer clientMode) {
    this.clientMode = clientMode;
  }

  public VpnUserRequest maxConnections(Integer maxConnections) {
    this.maxConnections = maxConnections;
    return this;
  }

  /**
   * Max connections should be within the range of 1–100.
   * @return maxConnections
  */
  @ApiModelProperty(value = "Max connections should be within the range of 1–100.")


  public Integer getMaxConnections() {
    return maxConnections;
  }

  public void setMaxConnections(Integer maxConnections) {
    this.maxConnections = maxConnections;
  }

  public VpnUserRequest userRemoteSubnets(List<IpSubnetsVo> userRemoteSubnets) {
    this.userRemoteSubnets = userRemoteSubnets;
    return this;
  }

  public VpnUserRequest addUserRemoteSubnetsItem(IpSubnetsVo userRemoteSubnetsItem) {
    if (this.userRemoteSubnets == null) {
      this.userRemoteSubnets = new ArrayList<>();
    }
    this.userRemoteSubnets.add(userRemoteSubnetsItem);
    return this;
  }

  /**
   * User remote subnets of the VPN user.
   * @return userRemoteSubnets
  */
  @ApiModelProperty(value = "User remote subnets of the VPN user.")

  @Valid

  public List<IpSubnetsVo> getUserRemoteSubnets() {
    return userRemoteSubnets;
  }

  public void setUserRemoteSubnets(List<IpSubnetsVo> userRemoteSubnets) {
    this.userRemoteSubnets = userRemoteSubnets;
  }

  public VpnUserRequest servers(List<String> servers) {
    this.servers = servers;
    return this;
  }

  public VpnUserRequest addServersItem(String serversItem) {
    this.servers.add(serversItem);
    return this;
  }

  /**
   * Servers of the VPN user. Server can be created using 'Create client-to-site VPN server' interface, and server ID can be obtained from 'Get client-to-site VPN server list' interface.
   * @return servers
  */
  @ApiModelProperty(required = true, value = "Servers of the VPN user. Server can be created using 'Create client-to-site VPN server' interface, and server ID can be obtained from 'Get client-to-site VPN server list' interface.")
  @NotNull


  public List<String> getServers() {
    return servers;
  }

  public void setServers(List<String> servers) {
    this.servers = servers;
  }

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

  /**
   * Local IP of the VPN user
   * @return localIp
  */
  @ApiModelProperty(value = "Local IP of the VPN user")


  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;
    }
    VpnUserRequest vpnUserRequest = (VpnUserRequest) o;
    return Objects.equals(this.username, vpnUserRequest.username) &&
        Objects.equals(this.password, vpnUserRequest.password) &&
        Objects.equals(this.protocol, vpnUserRequest.protocol) &&
        Objects.equals(this.clientMode, vpnUserRequest.clientMode) &&
        Objects.equals(this.maxConnections, vpnUserRequest.maxConnections) &&
        Objects.equals(this.userRemoteSubnets, vpnUserRequest.userRemoteSubnets) &&
        Objects.equals(this.servers, vpnUserRequest.servers) &&
        Objects.equals(this.localIp, vpnUserRequest.localIp);
  }

  @Override
  public int hashCode() {
    return Objects.hash(username, password, protocol, clientMode, maxConnections, userRemoteSubnets, servers, localIp);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VpnUserRequest {\n");
    
    sb.append("    username: ").append(toIndentedString(username)).append("\n");
    sb.append("    password: ").append(toIndentedString(password)).append("\n");
    sb.append("    protocol: ").append(toIndentedString(protocol)).append("\n");
    sb.append("    clientMode: ").append(toIndentedString(clientMode)).append("\n");
    sb.append("    maxConnections: ").append(toIndentedString(maxConnections)).append("\n");
    sb.append("    userRemoteSubnets: ").append(toIndentedString(userRemoteSubnets)).append("\n");
    sb.append("    servers: ").append(toIndentedString(servers)).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    ");
  }
}

