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;

/**
 * IP subnet info list. [type] value of 0 or 1 is required
 */
@ApiModel(description = "IP subnet info list. [type] value of 0 or 1 is required")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class IpSubnetsOpenApiVo   {
  @JsonProperty("ip")
  private String ip;

  @JsonProperty("mask")
  private Integer mask;

  @JsonProperty("description")
  private String description;

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

  /**
   * IP address, should be a valid IP format
   * @return ip
  */
  @ApiModelProperty(required = true, value = "IP address, should be a valid IP format")
  @NotNull

@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 IpSubnetsOpenApiVo mask(Integer mask) {
    this.mask = mask;
    return this;
  }

  /**
   * IP mask, mask should be within the range of 1-32
   * @return mask
  */
  @ApiModelProperty(required = true, value = "IP mask, mask should be within the range of 1-32")
  @NotNull


  public Integer getMask() {
    return mask;
  }

  public void setMask(Integer mask) {
    this.mask = mask;
  }

  public IpSubnetsOpenApiVo description(String description) {
    this.description = description;
    return this;
  }

  /**
   * IP description, description should contain 1 to 512 characters.
   * @return description
  */
  @ApiModelProperty(value = "IP description, description should contain 1 to 512 characters.")

@Pattern(regexp="^$|^[^ ]$|^[^ ].{0,510}[^ ]$") 
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IpSubnetsOpenApiVo ipSubnetsOpenApiVo = (IpSubnetsOpenApiVo) o;
    return Objects.equals(this.ip, ipSubnetsOpenApiVo.ip) &&
        Objects.equals(this.mask, ipSubnetsOpenApiVo.mask) &&
        Objects.equals(this.description, ipSubnetsOpenApiVo.description);
  }

  @Override
  public int hashCode() {
    return Objects.hash(ip, mask, description);
  }

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

