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

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

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

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

public class GatewayQosServiceOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("protocol")
  private Integer protocol;

  @JsonProperty("sourceStartPort")
  private Integer sourceStartPort;

  @JsonProperty("sourceEndPort")
  private Integer sourceEndPort;

  @JsonProperty("destStartPort")
  private Integer destStartPort;

  @JsonProperty("destEndPort")
  private Integer destEndPort;

  @JsonProperty("type")
  private Integer type;

  @JsonProperty("code")
  private Integer code;

  @JsonProperty("protoNum")
  private Integer protoNum;

  @JsonProperty("description")
  private String description;

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

  /**
   * The name of Gateway QoS Service should contain 1 to 64 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "The name of Gateway QoS Service should contain 1 to 64 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,62}[^ ]$") 
  public String getName() {
    return name;
  }

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

  public GatewayQosServiceOpenApiVo protocol(Integer protocol) {
    this.protocol = protocol;
    return this;
  }

  /**
   * The protocol of Gateway QoS Service should be a value as follows: 0: TCP, 1: UDP, 2: TCP/UDP, 3: ICMP, 4: Other.
   * @return protocol
  */
  @ApiModelProperty(required = true, value = "The protocol of Gateway QoS Service should be a value as follows: 0: TCP, 1: UDP, 2: TCP/UDP, 3: ICMP, 4: Other.")
  @NotNull


  public Integer getProtocol() {
    return protocol;
  }

  public void setProtocol(Integer protocol) {
    this.protocol = protocol;
  }

  public GatewayQosServiceOpenApiVo sourceStartPort(Integer sourceStartPort) {
    this.sourceStartPort = sourceStartPort;
    return this;
  }

  /**
   * The start port of Source Port Range. It must be less than the end port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).
   * @return sourceStartPort
  */
  @ApiModelProperty(value = "The start port of Source Port Range. It must be less than the end port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).")


  public Integer getSourceStartPort() {
    return sourceStartPort;
  }

  public void setSourceStartPort(Integer sourceStartPort) {
    this.sourceStartPort = sourceStartPort;
  }

  public GatewayQosServiceOpenApiVo sourceEndPort(Integer sourceEndPort) {
    this.sourceEndPort = sourceEndPort;
    return this;
  }

  /**
   * The end port of Source Port Range. It must be more than the start port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).
   * @return sourceEndPort
  */
  @ApiModelProperty(value = "The end port of Source Port Range. It must be more than the start port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).")


  public Integer getSourceEndPort() {
    return sourceEndPort;
  }

  public void setSourceEndPort(Integer sourceEndPort) {
    this.sourceEndPort = sourceEndPort;
  }

  public GatewayQosServiceOpenApiVo destStartPort(Integer destStartPort) {
    this.destStartPort = destStartPort;
    return this;
  }

  /**
   * The start port of Destination Port Range. It must be less than the end port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).
   * @return destStartPort
  */
  @ApiModelProperty(value = "The start port of Destination Port Range. It must be less than the end port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).")


  public Integer getDestStartPort() {
    return destStartPort;
  }

  public void setDestStartPort(Integer destStartPort) {
    this.destStartPort = destStartPort;
  }

  public GatewayQosServiceOpenApiVo destEndPort(Integer destEndPort) {
    this.destEndPort = destEndPort;
    return this;
  }

  /**
   * The end port of Destination Port Range. It must be more than the start port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).
   * @return destEndPort
  */
  @ApiModelProperty(value = "The end port of Destination Port Range. It must be more than the start port. It should be within the range of 0-65535 when protocol is 0(TCP), 1(UDP) or 2(TCP/UDP).")


  public Integer getDestEndPort() {
    return destEndPort;
  }

  public void setDestEndPort(Integer destEndPort) {
    this.destEndPort = destEndPort;
  }

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

  /**
   * The type cannot be null and should be within the range of 0-255 when protocol is 3(ICMP).
   * @return type
  */
  @ApiModelProperty(value = "The type cannot be null and should be within the range of 0-255 when protocol is 3(ICMP).")


  public Integer getType() {
    return type;
  }

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

  public GatewayQosServiceOpenApiVo code(Integer code) {
    this.code = code;
    return this;
  }

  /**
   * The code cannot be null and should be within the range of 0-255 when protocol is 3(ICMP).
   * @return code
  */
  @ApiModelProperty(value = "The code cannot be null and should be within the range of 0-255 when protocol is 3(ICMP).")


  public Integer getCode() {
    return code;
  }

  public void setCode(Integer code) {
    this.code = code;
  }

  public GatewayQosServiceOpenApiVo protoNum(Integer protoNum) {
    this.protoNum = protoNum;
    return this;
  }

  /**
   * The protoNum cannot be null and should be within the range of 1-255 when protocol is 4(Other).
   * @return protoNum
  */
  @ApiModelProperty(value = "The protoNum cannot be null and should be within the range of 1-255 when protocol is 4(Other).")


  public Integer getProtoNum() {
    return protoNum;
  }

  public void setProtoNum(Integer protoNum) {
    this.protoNum = protoNum;
  }

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

  /**
   * The description of Gateway QoS Service should contain 0 to 128 characters.
   * @return description
  */
  @ApiModelProperty(value = "The description of Gateway QoS Service should contain 0 to 128 characters.")

@Pattern(regexp="^$|^[^ ]$|^[^ ].{0,126}[^ ]$") 
  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;
    }
    GatewayQosServiceOpenApiVo gatewayQosServiceOpenApiVo = (GatewayQosServiceOpenApiVo) o;
    return Objects.equals(this.name, gatewayQosServiceOpenApiVo.name) &&
        Objects.equals(this.protocol, gatewayQosServiceOpenApiVo.protocol) &&
        Objects.equals(this.sourceStartPort, gatewayQosServiceOpenApiVo.sourceStartPort) &&
        Objects.equals(this.sourceEndPort, gatewayQosServiceOpenApiVo.sourceEndPort) &&
        Objects.equals(this.destStartPort, gatewayQosServiceOpenApiVo.destStartPort) &&
        Objects.equals(this.destEndPort, gatewayQosServiceOpenApiVo.destEndPort) &&
        Objects.equals(this.type, gatewayQosServiceOpenApiVo.type) &&
        Objects.equals(this.code, gatewayQosServiceOpenApiVo.code) &&
        Objects.equals(this.protoNum, gatewayQosServiceOpenApiVo.protoNum) &&
        Objects.equals(this.description, gatewayQosServiceOpenApiVo.description);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, protocol, sourceStartPort, sourceEndPort, destStartPort, destEndPort, type, code, protoNum, description);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GatewayQosServiceOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    protocol: ").append(toIndentedString(protocol)).append("\n");
    sb.append("    sourceStartPort: ").append(toIndentedString(sourceStartPort)).append("\n");
    sb.append("    sourceEndPort: ").append(toIndentedString(sourceEndPort)).append("\n");
    sb.append("    destStartPort: ").append(toIndentedString(destStartPort)).append("\n");
    sb.append("    destEndPort: ").append(toIndentedString(destEndPort)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    protoNum: ").append(toIndentedString(protoNum)).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    ");
  }
}

