package org.wfc.omada.api.accesscontrol.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;

/**
 * List of Pre-Authentication Access Policy
 */
@ApiModel(description = "List of Pre-Authentication Access Policy")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-06-03T18:17:18.126730900+08:00[Asia/Shanghai]")

public class PreAuthAccessPolicyOpenApiVo   {
  @JsonProperty("idInt")
  private Integer idInt;

  @JsonProperty("type")
  private Integer type;

  @JsonProperty("ip")
  private String ip;

  @JsonProperty("subnetMask")
  private Integer subnetMask;

  @JsonProperty("url")
  private String url;

  public PreAuthAccessPolicyOpenApiVo idInt(Integer idInt) {
    this.idInt = idInt;
    return this;
  }

  /**
   * Entry ID of the policy. Except for newly added policies, this parameter should be retained
   * @return idInt
  */
  @ApiModelProperty(value = "Entry ID of the policy. Except for newly added policies, this parameter should be retained")


  public Integer getIdInt() {
    return idInt;
  }

  public void setIdInt(Integer idInt) {
    this.idInt = idInt;
  }

  public PreAuthAccessPolicyOpenApiVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * Type of the policy. It should be a value as follows: 1: Destination IP Range, and parameter [ip] and [subnetMask] is needed. 2: URL, and parameter [url] is needed
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type of the policy. It should be a value as follows: 1: Destination IP Range, and parameter [ip] and [subnetMask] is needed. 2: URL, and parameter [url] is needed")
  @NotNull


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public PreAuthAccessPolicyOpenApiVo ip(String ip) {
    this.ip = ip;
    return this;
  }

  /**
   * IP Address of Pre-Authentication Access
   * @return ip
  */
  @ApiModelProperty(value = "IP Address of Pre-Authentication Access")

@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 getIp() {
    return ip;
  }

  public void setIp(String ip) {
    this.ip = ip;
  }

  public PreAuthAccessPolicyOpenApiVo subnetMask(Integer subnetMask) {
    this.subnetMask = subnetMask;
    return this;
  }

  /**
   * Subnet mask of Pre-Authentication Access. It should be within the range of 1-32
   * @return subnetMask
  */
  @ApiModelProperty(value = "Subnet mask of Pre-Authentication Access. It should be within the range of 1-32")


  public Integer getSubnetMask() {
    return subnetMask;
  }

  public void setSubnetMask(Integer subnetMask) {
    this.subnetMask = subnetMask;
  }

  public PreAuthAccessPolicyOpenApiVo url(String url) {
    this.url = url;
    return this;
  }

  /**
   * URL of Pre-Authentication Access
   * @return url
  */
  @ApiModelProperty(value = "URL of Pre-Authentication Access")

@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}(:([0-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{4}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]))?|([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,18}(:([0-9]|[1-9]\\d{1,3}|[1-5]\\d{4}|6[0-4]\\d{4}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5]))?)") 
  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PreAuthAccessPolicyOpenApiVo preAuthAccessPolicyOpenApiVo = (PreAuthAccessPolicyOpenApiVo) o;
    return Objects.equals(this.idInt, preAuthAccessPolicyOpenApiVo.idInt) &&
        Objects.equals(this.type, preAuthAccessPolicyOpenApiVo.type) &&
        Objects.equals(this.ip, preAuthAccessPolicyOpenApiVo.ip) &&
        Objects.equals(this.subnetMask, preAuthAccessPolicyOpenApiVo.subnetMask) &&
        Objects.equals(this.url, preAuthAccessPolicyOpenApiVo.url);
  }

  @Override
  public int hashCode() {
    return Objects.hash(idInt, type, ip, subnetMask, url);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PreAuthAccessPolicyOpenApiVo {\n");
    
    sb.append("    idInt: ").append(toIndentedString(idInt)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    ip: ").append(toIndentedString(ip)).append("\n");
    sb.append("    subnetMask: ").append(toIndentedString(subnetMask)).append("\n");
    sb.append("    url: ").append(toIndentedString(url)).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    ");
  }
}

