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

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

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

/**
 * ClientRateLimitSetting
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T10:16:05.926+08:00[Asia/Shanghai]")

public class ClientRateLimitSetting   {
  @JsonProperty("mode")
  private Integer mode;

  @JsonProperty("rateLimitProfileId")
  private String rateLimitProfileId;

  @JsonProperty("customRateLimit")
  private CustomRateLimitEntity customRateLimit;

  public ClientRateLimitSetting mode(Integer mode) {
    this.mode = mode;
    return this;
  }

  /**
   * Rate limit mode should be a value as follows: <br/>0: Custom mode. Apply the given rate limit value to the client; <br/>1: Rate limit profile mode. Find the corresponding rate limit file with rate limit ID and apply it to the client.
   * @return mode
  */
  @ApiModelProperty(required = true, value = "Rate limit mode should be a value as follows: <br/>0: Custom mode. Apply the given rate limit value to the client; <br/>1: Rate limit profile mode. Find the corresponding rate limit file with rate limit ID and apply it to the client.")
  @NotNull


  public Integer getMode() {
    return mode;
  }

  public void setMode(Integer mode) {
    this.mode = mode;
  }

  public ClientRateLimitSetting rateLimitProfileId(String rateLimitProfileId) {
    this.rateLimitProfileId = rateLimitProfileId;
    return this;
  }

  /**
   * Rate limit profile ID. Required when ratelimit mode is 1
   * @return rateLimitProfileId
  */
  @ApiModelProperty(value = "Rate limit profile ID. Required when ratelimit mode is 1")


  public String getRateLimitProfileId() {
    return rateLimitProfileId;
  }

  public void setRateLimitProfileId(String rateLimitProfileId) {
    this.rateLimitProfileId = rateLimitProfileId;
  }

  public ClientRateLimitSetting customRateLimit(CustomRateLimitEntity customRateLimit) {
    this.customRateLimit = customRateLimit;
    return this;
  }

  /**
   * Get customRateLimit
   * @return customRateLimit
  */
  @ApiModelProperty(value = "")

  @Valid

  public CustomRateLimitEntity getCustomRateLimit() {
    return customRateLimit;
  }

  public void setCustomRateLimit(CustomRateLimitEntity customRateLimit) {
    this.customRateLimit = customRateLimit;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientRateLimitSetting clientRateLimitSetting = (ClientRateLimitSetting) o;
    return Objects.equals(this.mode, clientRateLimitSetting.mode) &&
        Objects.equals(this.rateLimitProfileId, clientRateLimitSetting.rateLimitProfileId) &&
        Objects.equals(this.customRateLimit, clientRateLimitSetting.customRateLimit);
  }

  @Override
  public int hashCode() {
    return Objects.hash(mode, rateLimitProfileId, customRateLimit);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ClientRateLimitSetting {\n");
    
    sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
    sb.append("    rateLimitProfileId: ").append(toIndentedString(rateLimitProfileId)).append("\n");
    sb.append("    customRateLimit: ").append(toIndentedString(customRateLimit)).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    ");
  }
}

