RateLimitingPolicyCriteri.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.core.config.rs.server.model;

  21. import javax.validation.constraints.*;

  22. import io.swagger.v3.oas.annotations.media.Schema;
  23. import com.fasterxml.jackson.annotation.JsonProperty;
  24. import javax.validation.Valid;

  25. public class RateLimitingPolicyCriteri  implements OneOfRateLimitingPolicyBaseConIdentificazioneConfigurazione {
  26.  
  27.   @Schema(required = true, description = "")
  28.   private RateLimitingIdentificazionePolicyEnum identificazione = null;
  29.  
  30.   @Schema(required = true, description = "")
  31.   private RateLimitingCriteriMetricaEnum metrica = null;
  32.  
  33.   @Schema(description = "")
  34.   private RateLimitingCriteriIntervalloEnum intervallo = null;
  35.  
  36.   @Schema(example = "false", description = "")
  37.   private Boolean congestione = false;
  38.  
  39.   @Schema(example = "false", description = "")
  40.   private Boolean degrado = false;
  41.  /**
  42.    * Get identificazione
  43.    * @return identificazione
  44.   **/
  45.   @Override
  46. @JsonProperty("identificazione")
  47.   @NotNull
  48.   @Valid
  49.   public RateLimitingIdentificazionePolicyEnum getIdentificazione() {
  50.     return this.identificazione;
  51.   }

  52.   public void setIdentificazione(RateLimitingIdentificazionePolicyEnum identificazione) {
  53.     this.identificazione = identificazione;
  54.   }

  55.   public RateLimitingPolicyCriteri identificazione(RateLimitingIdentificazionePolicyEnum identificazione) {
  56.     this.identificazione = identificazione;
  57.     return this;
  58.   }

  59.  /**
  60.    * Get metrica
  61.    * @return metrica
  62.   **/
  63.   @JsonProperty("metrica")
  64.   @NotNull
  65.   @Valid
  66.   public RateLimitingCriteriMetricaEnum getMetrica() {
  67.     return this.metrica;
  68.   }

  69.   public void setMetrica(RateLimitingCriteriMetricaEnum metrica) {
  70.     this.metrica = metrica;
  71.   }

  72.   public RateLimitingPolicyCriteri metrica(RateLimitingCriteriMetricaEnum metrica) {
  73.     this.metrica = metrica;
  74.     return this;
  75.   }

  76.  /**
  77.    * Get intervallo
  78.    * @return intervallo
  79.   **/
  80.   @JsonProperty("intervallo")
  81.   @Valid
  82.   public RateLimitingCriteriIntervalloEnum getIntervallo() {
  83.     return this.intervallo;
  84.   }

  85.   public void setIntervallo(RateLimitingCriteriIntervalloEnum intervallo) {
  86.     this.intervallo = intervallo;
  87.   }

  88.   public RateLimitingPolicyCriteri intervallo(RateLimitingCriteriIntervalloEnum intervallo) {
  89.     this.intervallo = intervallo;
  90.     return this;
  91.   }

  92.  /**
  93.    * Get congestione
  94.    * @return congestione
  95.   **/
  96.   @JsonProperty("congestione")
  97.   @Valid
  98.   public Boolean isCongestione() {
  99.     return this.congestione;
  100.   }

  101.   public void setCongestione(Boolean congestione) {
  102.     this.congestione = congestione;
  103.   }

  104.   public RateLimitingPolicyCriteri congestione(Boolean congestione) {
  105.     this.congestione = congestione;
  106.     return this;
  107.   }

  108.  /**
  109.    * Get degrado
  110.    * @return degrado
  111.   **/
  112.   @JsonProperty("degrado")
  113.   @Valid
  114.   public Boolean isDegrado() {
  115.     return this.degrado;
  116.   }

  117.   public void setDegrado(Boolean degrado) {
  118.     this.degrado = degrado;
  119.   }

  120.   public RateLimitingPolicyCriteri degrado(Boolean degrado) {
  121.     this.degrado = degrado;
  122.     return this;
  123.   }


  124.   @Override
  125.   public String toString() {
  126.     StringBuilder sb = new StringBuilder();
  127.     sb.append("class RateLimitingPolicyCriteri {\n");
  128.    
  129.     sb.append("    identificazione: ").append(RateLimitingPolicyCriteri.toIndentedString(this.identificazione)).append("\n");
  130.     sb.append("    metrica: ").append(RateLimitingPolicyCriteri.toIndentedString(this.metrica)).append("\n");
  131.     sb.append("    intervallo: ").append(RateLimitingPolicyCriteri.toIndentedString(this.intervallo)).append("\n");
  132.     sb.append("    congestione: ").append(RateLimitingPolicyCriteri.toIndentedString(this.congestione)).append("\n");
  133.     sb.append("    degrado: ").append(RateLimitingPolicyCriteri.toIndentedString(this.degrado)).append("\n");
  134.     sb.append("}");
  135.     return sb.toString();
  136.   }

  137.   /**
  138.    * Convert the given object to string with each line indented by 4 spaces
  139.    * (except the first line).
  140.    */
  141.   private static String toIndentedString(java.lang.Object o) {
  142.     if (o == null) {
  143.       return "null";
  144.     }
  145.     return o.toString().replace("\n", "\n    ");
  146.   }
  147. }