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

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

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class VpnUser   {
  @JsonProperty("id")
  private String id;

  @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 = null;

  @JsonProperty("localIp")
  private String localIp;

  @JsonProperty("serverNames")
  private String serverNames;

  public VpnUser id(String id) {
    this.id = id;
    return this;
  }

  /**
   * ID of the VPN user.
   * @return id
  */
  @ApiModelProperty(value = "ID of the VPN user.")


  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

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

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


  public String getUsername() {
    return username;
  }

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

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

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


  public String getPassword() {
    return password;
  }

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

  public VpnUser 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 VpnUser 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 VpnUser 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 VpnUser userRemoteSubnets(List<IpSubnetsVo> userRemoteSubnets) {
    this.userRemoteSubnets = userRemoteSubnets;
    return this;
  }

  public VpnUser 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 VpnUser servers(List<String> servers) {
    this.servers = servers;
    return this;
  }

  public VpnUser addServersItem(String serversItem) {
    if (this.servers == null) {
      this.servers = new ArrayList<>();
    }
    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(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.")


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

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

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

  public VpnUser serverNames(String serverNames) {
    this.serverNames = serverNames;
    return this;
  }

  /**
   * Server names of the VPN user.
   * @return serverNames
  */
  @ApiModelProperty(value = "Server names of the VPN user.")


  public String getServerNames() {
    return serverNames;
  }

  public void setServerNames(String serverNames) {
    this.serverNames = serverNames;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VpnUser vpnUser = (VpnUser) o;
    return Objects.equals(this.id, vpnUser.id) &&
        Objects.equals(this.username, vpnUser.username) &&
        Objects.equals(this.password, vpnUser.password) &&
        Objects.equals(this.protocol, vpnUser.protocol) &&
        Objects.equals(this.clientMode, vpnUser.clientMode) &&
        Objects.equals(this.maxConnections, vpnUser.maxConnections) &&
        Objects.equals(this.userRemoteSubnets, vpnUser.userRemoteSubnets) &&
        Objects.equals(this.servers, vpnUser.servers) &&
        Objects.equals(this.localIp, vpnUser.localIp) &&
        Objects.equals(this.serverNames, vpnUser.serverNames);
  }

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

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VpnUser {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\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("    serverNames: ").append(toIndentedString(serverNames)).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    ");
  }
}

