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

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

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

/**
 * Custom Service list. Up to 2 DoH default and custom Servers can be selected, setting the parameter [enable] to true indicates the selection of the custom server. Up to 8 custom servers can be configured
 */
@ApiModel(description = "Custom Service list. Up to 2 DoH default and custom Servers can be selected, setting the parameter [enable] to true indicates the selection of the custom server. Up to 8 custom servers can be configured")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class DohCustomizedServerOpenApiVo   {
  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("name")
  private String name;

  @JsonProperty("server")
  private String server;

  public DohCustomizedServerOpenApiVo enable(Boolean enable) {
    this.enable = enable;
    return this;
  }

  /**
   * Custom service enable status
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Custom service enable status")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

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

  /**
   * Custom service name, should contain 1 to 64 characters
   * @return name
  */
  @ApiModelProperty(required = true, value = "Custom service name, should contain 1 to 64 characters")
  @NotNull


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public DohCustomizedServerOpenApiVo server(String server) {
    this.server = server;
    return this;
  }

  /**
   * Custom service IP or domain
   * @return server
  */
  @ApiModelProperty(required = true, value = "Custom service IP or domain")
  @NotNull

@Pattern(regexp="((\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])(\\.(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])){3}|([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6})") 
  public String getServer() {
    return server;
  }

  public void setServer(String server) {
    this.server = server;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DohCustomizedServerOpenApiVo dohCustomizedServerOpenApiVo = (DohCustomizedServerOpenApiVo) o;
    return Objects.equals(this.enable, dohCustomizedServerOpenApiVo.enable) &&
        Objects.equals(this.name, dohCustomizedServerOpenApiVo.name) &&
        Objects.equals(this.server, dohCustomizedServerOpenApiVo.server);
  }

  @Override
  public int hashCode() {
    return Objects.hash(enable, name, server);
  }

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

