Scope.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 Scope  {
  26.  
  27.   @Schema(required = true, description = "")
  28.   private String nome = null;
  29.  
  30.   @Schema(example = "descrizione dello scope", description = "")
  31.   private String descrizione = null;
  32.  
  33.   @Schema(example = "urn://accesso_sola_lettura", description = "")
  34.   private String identificativoEsterno = null;
  35.  
  36.   @Schema(description = "")
  37.   private ContestoEnum contesto = null;
  38.  /**
  39.    * Get nome
  40.    * @return nome
  41.   **/
  42.   @JsonProperty("nome")
  43.   @NotNull
  44.   @Valid
  45.  @Pattern(regexp="^[_A-Za-z][\\-\\._A-Za-z0-9]*$") @Size(max=255)  public String getNome() {
  46.     return this.nome;
  47.   }

  48.   public void setNome(String nome) {
  49.     this.nome = nome;
  50.   }

  51.   public Scope nome(String nome) {
  52.     this.nome = nome;
  53.     return this;
  54.   }

  55.  /**
  56.    * Get descrizione
  57.    * @return descrizione
  58.   **/
  59.   @JsonProperty("descrizione")
  60.   @Valid
  61.  @Size(max=4000)  public String getDescrizione() {
  62.     return this.descrizione;
  63.   }

  64.   public void setDescrizione(String descrizione) {
  65.     this.descrizione = descrizione;
  66.   }

  67.   public Scope descrizione(String descrizione) {
  68.     this.descrizione = descrizione;
  69.     return this;
  70.   }

  71.  /**
  72.    * Get identificativoEsterno
  73.    * @return identificativoEsterno
  74.   **/
  75.   @JsonProperty("identificativo_esterno")
  76.   @Valid
  77.  @Size(max=255)  public String getIdentificativoEsterno() {
  78.     return this.identificativoEsterno;
  79.   }

  80.   public void setIdentificativoEsterno(String identificativoEsterno) {
  81.     this.identificativoEsterno = identificativoEsterno;
  82.   }

  83.   public Scope identificativoEsterno(String identificativoEsterno) {
  84.     this.identificativoEsterno = identificativoEsterno;
  85.     return this;
  86.   }

  87.  /**
  88.    * Get contesto
  89.    * @return contesto
  90.   **/
  91.   @JsonProperty("contesto")
  92.   @Valid
  93.   public ContestoEnum getContesto() {
  94.     return this.contesto;
  95.   }

  96.   public void setContesto(ContestoEnum contesto) {
  97.     this.contesto = contesto;
  98.   }

  99.   public Scope contesto(ContestoEnum contesto) {
  100.     this.contesto = contesto;
  101.     return this;
  102.   }


  103.   @Override
  104.   public String toString() {
  105.     StringBuilder sb = new StringBuilder();
  106.     sb.append("class Scope {\n");
  107.    
  108.     sb.append("    nome: ").append(Scope.toIndentedString(this.nome)).append("\n");
  109.     sb.append("    descrizione: ").append(Scope.toIndentedString(this.descrizione)).append("\n");
  110.     sb.append("    identificativoEsterno: ").append(Scope.toIndentedString(this.identificativoEsterno)).append("\n");
  111.     sb.append("    contesto: ").append(Scope.toIndentedString(this.contesto)).append("\n");
  112.     sb.append("}");
  113.     return sb.toString();
  114.   }

  115.   /**
  116.    * Convert the given object to string with each line indented by 4 spaces
  117.    * (except the first line).
  118.    */
  119.   private static String toIndentedString(java.lang.Object o) {
  120.     if (o == null) {
  121.       return "null";
  122.     }
  123.     return o.toString().replace("\n", "\n    ");
  124.   }
  125. }