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 Free-Authentication Client Policy
 */
@ApiModel(description = "List of Free-Authentication Client Policy")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2025-06-03T18:17:18.126730900+08:00[Asia/Shanghai]")

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

  @JsonProperty("type")
  private Integer type;

  @JsonProperty("clientIp")
  private String clientIp;

  @JsonProperty("clientMac")
  private String clientMac;

  public FreeAuthClientPolicyOpenApiVo 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 FreeAuthClientPolicyOpenApiVo type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * Type of the policy. It should be a value as follows: 3: Free auth client IP, and parameter [clientIp] is needed. 4: Free auth client MAC, and parameter [clientMac] is needed
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type of the policy. It should be a value as follows: 3: Free auth client IP, and parameter [clientIp] is needed. 4: Free auth client MAC, and parameter [clientMac] is needed")
  @NotNull


  public Integer getType() {
    return type;
  }

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

  public FreeAuthClientPolicyOpenApiVo clientIp(String clientIp) {
    this.clientIp = clientIp;
    return this;
  }

  /**
   * Free auth client IP Address
   * @return clientIp
  */
  @ApiModelProperty(value = "Free auth client IP Address")

@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 getClientIp() {
    return clientIp;
  }

  public void setClientIp(String clientIp) {
    this.clientIp = clientIp;
  }

  public FreeAuthClientPolicyOpenApiVo clientMac(String clientMac) {
    this.clientMac = clientMac;
    return this;
  }

  /**
   * Free auth client MAC Address, for example: AA-AA-AA-AA-AA-AA
   * @return clientMac
  */
  @ApiModelProperty(value = "Free auth client MAC Address, for example: AA-AA-AA-AA-AA-AA")

@Pattern(regexp="[A-Fa-f0-9]{1}[02468aceACE]{1}([-:][A-Fa-f0-9]{2}){5}") 
  public String getClientMac() {
    return clientMac;
  }

  public void setClientMac(String clientMac) {
    this.clientMac = clientMac;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    FreeAuthClientPolicyOpenApiVo freeAuthClientPolicyOpenApiVo = (FreeAuthClientPolicyOpenApiVo) o;
    return Objects.equals(this.idInt, freeAuthClientPolicyOpenApiVo.idInt) &&
        Objects.equals(this.type, freeAuthClientPolicyOpenApiVo.type) &&
        Objects.equals(this.clientIp, freeAuthClientPolicyOpenApiVo.clientIp) &&
        Objects.equals(this.clientMac, freeAuthClientPolicyOpenApiVo.clientMac);
  }

  @Override
  public int hashCode() {
    return Objects.hash(idInt, type, clientIp, clientMac);
  }

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

