CachingRisposta.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 java.util.List;
  22. import javax.validation.constraints.*;

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

  26. public class CachingRisposta extends ApiImplConfigurazioneStato {
  27.  
  28.   @Schema(required = true, description = "")
  29.   private StatoDefaultRidefinitoEnum stato = null;
  30.  
  31.   @Schema(description = "")
  32.   private Boolean abilitato = null;
  33.  
  34.   @Schema(description = "")
  35.   private Integer cacheTimeoutSeconds = null;
  36.  
  37.   @Schema(description = "")
  38.   private Boolean maxResponseSize = null;
  39.  
  40.   @Schema(description = "")
  41.   private Long maxResponseSizeKb = null;
  42.  
  43.   @Schema(description = "")
  44.   private Boolean hashRequestUri = true;
  45.  
  46.   @Schema(description = "")
  47.   private Boolean hashAllQueryParameters = true;
  48.  
  49.   @Schema(description = "")
  50.   private List<String> hashQueryParamaters = null;
  51.  
  52.   @Schema(description = "")
  53.   private List<String> hashHeaders = null;
  54.  
  55.   @Schema(description = "")
  56.   private Boolean hashPayload = true;
  57.  
  58.   @Schema(description = "")
  59.   private Boolean controlNoCache = true;
  60.  
  61.   @Schema(description = "")
  62.   private Boolean controlNoStore = true;
  63.  
  64.   @Schema(description = "")
  65.   private Boolean controlMaxAge = true;
  66.  
  67.   @Schema(description = "")
  68.   private List<CachingRispostaRegola> regole = null;
  69.  /**
  70.    * Get stato
  71.    * @return stato
  72.   **/
  73.   @JsonProperty("stato")
  74.   @NotNull
  75.   @Valid
  76.   public StatoDefaultRidefinitoEnum getStato() {
  77.     return this.stato;
  78.   }

  79.   public void setStato(StatoDefaultRidefinitoEnum stato) {
  80.     this.stato = stato;
  81.   }

  82.   public CachingRisposta stato(StatoDefaultRidefinitoEnum stato) {
  83.     this.stato = stato;
  84.     return this;
  85.   }

  86.  /**
  87.    * Get abilitato
  88.    * @return abilitato
  89.   **/
  90.   @JsonProperty("abilitato")
  91.   @Valid
  92.   public Boolean isAbilitato() {
  93.     return this.abilitato;
  94.   }

  95.   public void setAbilitato(Boolean abilitato) {
  96.     this.abilitato = abilitato;
  97.   }

  98.   public CachingRisposta abilitato(Boolean abilitato) {
  99.     this.abilitato = abilitato;
  100.     return this;
  101.   }

  102.  /**
  103.    * Get cacheTimeoutSeconds
  104.    * @return cacheTimeoutSeconds
  105.   **/
  106.   @JsonProperty("cache_timeout_seconds")
  107.   @Valid
  108.   public Integer getCacheTimeoutSeconds() {
  109.     return this.cacheTimeoutSeconds;
  110.   }

  111.   public void setCacheTimeoutSeconds(Integer cacheTimeoutSeconds) {
  112.     this.cacheTimeoutSeconds = cacheTimeoutSeconds;
  113.   }

  114.   public CachingRisposta cacheTimeoutSeconds(Integer cacheTimeoutSeconds) {
  115.     this.cacheTimeoutSeconds = cacheTimeoutSeconds;
  116.     return this;
  117.   }

  118.  /**
  119.    * Get maxResponseSize
  120.    * @return maxResponseSize
  121.   **/
  122.   @JsonProperty("max_response_size")
  123.   @Valid
  124.   public Boolean isMaxResponseSize() {
  125.     return this.maxResponseSize;
  126.   }

  127.   public void setMaxResponseSize(Boolean maxResponseSize) {
  128.     this.maxResponseSize = maxResponseSize;
  129.   }

  130.   public CachingRisposta maxResponseSize(Boolean maxResponseSize) {
  131.     this.maxResponseSize = maxResponseSize;
  132.     return this;
  133.   }

  134.  /**
  135.    * Get maxResponseSizeKb
  136.    * @return maxResponseSizeKb
  137.   **/
  138.   @JsonProperty("max_response_size_kb")
  139.   @Valid
  140.   public Long getMaxResponseSizeKb() {
  141.     return this.maxResponseSizeKb;
  142.   }

  143.   public void setMaxResponseSizeKb(Long maxResponseSizeKb) {
  144.     this.maxResponseSizeKb = maxResponseSizeKb;
  145.   }

  146.   public CachingRisposta maxResponseSizeKb(Long maxResponseSizeKb) {
  147.     this.maxResponseSizeKb = maxResponseSizeKb;
  148.     return this;
  149.   }

  150.  /**
  151.    * Get hashRequestUri
  152.    * @return hashRequestUri
  153.   **/
  154.   @JsonProperty("hash_request_uri")
  155.   @Valid
  156.   public Boolean isHashRequestUri() {
  157.     return this.hashRequestUri;
  158.   }

  159.   public void setHashRequestUri(Boolean hashRequestUri) {
  160.     this.hashRequestUri = hashRequestUri;
  161.   }

  162.   public CachingRisposta hashRequestUri(Boolean hashRequestUri) {
  163.     this.hashRequestUri = hashRequestUri;
  164.     return this;
  165.   }

  166.  /**
  167.    * Get hashAllQueryParameters
  168.    * @return hashAllQueryParameters
  169.   **/
  170.   @JsonProperty("hash_all_query_parameters")
  171.   @Valid
  172.   public Boolean isHashAllQueryParameters() {
  173.     return this.hashAllQueryParameters;
  174.   }

  175.   public void setHashAllQueryParameters(Boolean hashAllQueryParameters) {
  176.     this.hashAllQueryParameters = hashAllQueryParameters;
  177.   }

  178.   public CachingRisposta hashAllQueryParameters(Boolean hashAllQueryParameters) {
  179.     this.hashAllQueryParameters = hashAllQueryParameters;
  180.     return this;
  181.   }

  182.  /**
  183.    * Get hashQueryParamaters
  184.    * @return hashQueryParamaters
  185.   **/
  186.   @JsonProperty("hash_query_paramaters")
  187.   @Valid
  188.   public List<String> getHashQueryParamaters() {
  189.     return this.hashQueryParamaters;
  190.   }

  191.   public void setHashQueryParamaters(List<String> hashQueryParamaters) {
  192.     this.hashQueryParamaters = hashQueryParamaters;
  193.   }

  194.   public CachingRisposta hashQueryParamaters(List<String> hashQueryParamaters) {
  195.     this.hashQueryParamaters = hashQueryParamaters;
  196.     return this;
  197.   }

  198.   public CachingRisposta addHashQueryParamatersItem(String hashQueryParamatersItem) {
  199.     this.hashQueryParamaters.add(hashQueryParamatersItem);
  200.     return this;
  201.   }

  202.  /**
  203.    * Get hashHeaders
  204.    * @return hashHeaders
  205.   **/
  206.   @JsonProperty("hash_headers")
  207.   @Valid
  208.   public List<String> getHashHeaders() {
  209.     return this.hashHeaders;
  210.   }

  211.   public void setHashHeaders(List<String> hashHeaders) {
  212.     this.hashHeaders = hashHeaders;
  213.   }

  214.   public CachingRisposta hashHeaders(List<String> hashHeaders) {
  215.     this.hashHeaders = hashHeaders;
  216.     return this;
  217.   }

  218.   public CachingRisposta addHashHeadersItem(String hashHeadersItem) {
  219.     this.hashHeaders.add(hashHeadersItem);
  220.     return this;
  221.   }

  222.  /**
  223.    * Get hashPayload
  224.    * @return hashPayload
  225.   **/
  226.   @JsonProperty("hash_payload")
  227.   @Valid
  228.   public Boolean isHashPayload() {
  229.     return this.hashPayload;
  230.   }

  231.   public void setHashPayload(Boolean hashPayload) {
  232.     this.hashPayload = hashPayload;
  233.   }

  234.   public CachingRisposta hashPayload(Boolean hashPayload) {
  235.     this.hashPayload = hashPayload;
  236.     return this;
  237.   }

  238.  /**
  239.    * Get controlNoCache
  240.    * @return controlNoCache
  241.   **/
  242.   @JsonProperty("control_no_cache")
  243.   @Valid
  244.   public Boolean isControlNoCache() {
  245.     return this.controlNoCache;
  246.   }

  247.   public void setControlNoCache(Boolean controlNoCache) {
  248.     this.controlNoCache = controlNoCache;
  249.   }

  250.   public CachingRisposta controlNoCache(Boolean controlNoCache) {
  251.     this.controlNoCache = controlNoCache;
  252.     return this;
  253.   }

  254.  /**
  255.    * Get controlNoStore
  256.    * @return controlNoStore
  257.   **/
  258.   @JsonProperty("control_no_store")
  259.   @Valid
  260.   public Boolean isControlNoStore() {
  261.     return this.controlNoStore;
  262.   }

  263.   public void setControlNoStore(Boolean controlNoStore) {
  264.     this.controlNoStore = controlNoStore;
  265.   }

  266.   public CachingRisposta controlNoStore(Boolean controlNoStore) {
  267.     this.controlNoStore = controlNoStore;
  268.     return this;
  269.   }

  270.  /**
  271.    * Get controlMaxAge
  272.    * @return controlMaxAge
  273.   **/
  274.   @JsonProperty("control_max_age")
  275.   @Valid
  276.   public Boolean isControlMaxAge() {
  277.     return this.controlMaxAge;
  278.   }

  279.   public void setControlMaxAge(Boolean controlMaxAge) {
  280.     this.controlMaxAge = controlMaxAge;
  281.   }

  282.   public CachingRisposta controlMaxAge(Boolean controlMaxAge) {
  283.     this.controlMaxAge = controlMaxAge;
  284.     return this;
  285.   }

  286.  /**
  287.    * Get regole
  288.    * @return regole
  289.   **/
  290.   @JsonProperty("regole")
  291.   @Valid
  292.   public List<CachingRispostaRegola> getRegole() {
  293.     return this.regole;
  294.   }

  295.   public void setRegole(List<CachingRispostaRegola> regole) {
  296.     this.regole = regole;
  297.   }

  298.   public CachingRisposta regole(List<CachingRispostaRegola> regole) {
  299.     this.regole = regole;
  300.     return this;
  301.   }

  302.   public CachingRisposta addRegoleItem(CachingRispostaRegola regoleItem) {
  303.     this.regole.add(regoleItem);
  304.     return this;
  305.   }


  306.   @Override
  307.   public String toString() {
  308.     StringBuilder sb = new StringBuilder();
  309.     sb.append("class CachingRisposta {\n");
  310.     sb.append("    ").append(CachingRisposta.toIndentedString(super.toString())).append("\n");
  311.     sb.append("    stato: ").append(CachingRisposta.toIndentedString(this.stato)).append("\n");
  312.     sb.append("    abilitato: ").append(CachingRisposta.toIndentedString(this.abilitato)).append("\n");
  313.     sb.append("    cacheTimeoutSeconds: ").append(CachingRisposta.toIndentedString(this.cacheTimeoutSeconds)).append("\n");
  314.     sb.append("    maxResponseSize: ").append(CachingRisposta.toIndentedString(this.maxResponseSize)).append("\n");
  315.     sb.append("    maxResponseSizeKb: ").append(CachingRisposta.toIndentedString(this.maxResponseSizeKb)).append("\n");
  316.     sb.append("    hashRequestUri: ").append(CachingRisposta.toIndentedString(this.hashRequestUri)).append("\n");
  317.     sb.append("    hashAllQueryParameters: ").append(CachingRisposta.toIndentedString(this.hashAllQueryParameters)).append("\n");
  318.     sb.append("    hashQueryParamaters: ").append(CachingRisposta.toIndentedString(this.hashQueryParamaters)).append("\n");
  319.     sb.append("    hashHeaders: ").append(CachingRisposta.toIndentedString(this.hashHeaders)).append("\n");
  320.     sb.append("    hashPayload: ").append(CachingRisposta.toIndentedString(this.hashPayload)).append("\n");
  321.     sb.append("    controlNoCache: ").append(CachingRisposta.toIndentedString(this.controlNoCache)).append("\n");
  322.     sb.append("    controlNoStore: ").append(CachingRisposta.toIndentedString(this.controlNoStore)).append("\n");
  323.     sb.append("    controlMaxAge: ").append(CachingRisposta.toIndentedString(this.controlMaxAge)).append("\n");
  324.     sb.append("    regole: ").append(CachingRisposta.toIndentedString(this.regole)).append("\n");
  325.     sb.append("}");
  326.     return sb.toString();
  327.   }

  328.   /**
  329.    * Convert the given object to string with each line indented by 4 spaces
  330.    * (except the first line).
  331.    */
  332.   private static String toIndentedString(java.lang.Object o) {
  333.     if (o == null) {
  334.       return "null";
  335.     }
  336.     return o.toString().replace("\n", "\n    ");
  337.   }
  338. }