ApiBase.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 ApiBase  {
  27.  
  28.   @Schema(description = "")
  29.   private String referente = null;
  30.  
  31.   @Schema(required = true, description = "")
  32.   @com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY, property = "protocollo", visible = true )
  33.   @com.fasterxml.jackson.annotation.JsonSubTypes({
  34.     @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = ApiInterfacciaRest.class, name = "rest"),
  35.     @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = ApiInterfacciaSoap.class, name = "soap")  })
  36.   private OneOfApiBaseTipoInterfaccia tipoInterfaccia = null;
  37.  
  38.   @Schema(required = true, description = "")
  39.   private String nome = null;
  40.  
  41.   @Schema(example = "descrizione API", description = "")
  42.   private String descrizione = null;
  43.  
  44.   @Schema(required = true, description = "")
  45.   private Integer versione = null;
  46.  
  47.   @Schema(example = "[\"PagamentiTelematici\",\"Anagrafica\"]", description = "")
  48.   private List<String> tags = null;
  49.  /**
  50.    * Get referente
  51.    * @return referente
  52.   **/
  53.   @JsonProperty("referente")
  54.   @Valid
  55.  @Pattern(regexp="^[0-9A-Za-z][\\-A-Za-z0-9]*$") @Size(max=255)  public String getReferente() {
  56.     return this.referente;
  57.   }

  58.   public void setReferente(String referente) {
  59.     this.referente = referente;
  60.   }

  61.   public ApiBase referente(String referente) {
  62.     this.referente = referente;
  63.     return this;
  64.   }

  65.  /**
  66.    * Get tipoInterfaccia
  67.    * @return tipoInterfaccia
  68.   **/
  69.   @JsonProperty("tipo_interfaccia")
  70.   @NotNull
  71.   @Valid
  72.   public OneOfApiBaseTipoInterfaccia getTipoInterfaccia() {
  73.     return this.tipoInterfaccia;
  74.   }

  75.   public void setTipoInterfaccia(OneOfApiBaseTipoInterfaccia tipoInterfaccia) {
  76.     this.tipoInterfaccia = tipoInterfaccia;
  77.   }

  78.   public ApiBase tipoInterfaccia(OneOfApiBaseTipoInterfaccia tipoInterfaccia) {
  79.     this.tipoInterfaccia = tipoInterfaccia;
  80.     return this;
  81.   }

  82.  /**
  83.    * Get nome
  84.    * @return nome
  85.   **/
  86.   @JsonProperty("nome")
  87.   @NotNull
  88.   @Valid
  89.  @Pattern(regexp="^[_A-Za-z][\\-\\._A-Za-z0-9]*$") @Size(max=255)  public String getNome() {
  90.     return this.nome;
  91.   }

  92.   public void setNome(String nome) {
  93.     this.nome = nome;
  94.   }

  95.   public ApiBase nome(String nome) {
  96.     this.nome = nome;
  97.     return this;
  98.   }

  99.  /**
  100.    * Get descrizione
  101.    * @return descrizione
  102.   **/
  103.   @JsonProperty("descrizione")
  104.   @Valid
  105.  @Size(max=4000)  public String getDescrizione() {
  106.     return this.descrizione;
  107.   }

  108.   public void setDescrizione(String descrizione) {
  109.     this.descrizione = descrizione;
  110.   }

  111.   public ApiBase descrizione(String descrizione) {
  112.     this.descrizione = descrizione;
  113.     return this;
  114.   }

  115.  /**
  116.    * Get versione
  117.    * @return versione
  118.   **/
  119.   @JsonProperty("versione")
  120.   @NotNull
  121.   @Valid
  122.   public Integer getVersione() {
  123.     return this.versione;
  124.   }

  125.   public void setVersione(Integer versione) {
  126.     this.versione = versione;
  127.   }

  128.   public ApiBase versione(Integer versione) {
  129.     this.versione = versione;
  130.     return this;
  131.   }

  132.  /**
  133.    * Get tags
  134.    * @return tags
  135.   **/
  136.   @JsonProperty("tags")
  137.   @Valid
  138.   public List<String> getTags() {
  139.     return this.tags;
  140.   }

  141.   public void setTags(List<String> tags) {
  142.     this.tags = tags;
  143.   }

  144.   public ApiBase tags(List<String> tags) {
  145.     this.tags = tags;
  146.     return this;
  147.   }

  148.   public ApiBase addTagsItem(String tagsItem) {
  149.     this.tags.add(tagsItem);
  150.     return this;
  151.   }


  152.   @Override
  153.   public String toString() {
  154.     StringBuilder sb = new StringBuilder();
  155.     sb.append("class ApiBase {\n");
  156.    
  157.     sb.append("    referente: ").append(ApiBase.toIndentedString(this.referente)).append("\n");
  158.     sb.append("    tipoInterfaccia: ").append(ApiBase.toIndentedString(this.tipoInterfaccia)).append("\n");
  159.     sb.append("    nome: ").append(ApiBase.toIndentedString(this.nome)).append("\n");
  160.     sb.append("    descrizione: ").append(ApiBase.toIndentedString(this.descrizione)).append("\n");
  161.     sb.append("    versione: ").append(ApiBase.toIndentedString(this.versione)).append("\n");
  162.     sb.append("    tags: ").append(ApiBase.toIndentedString(this.tags)).append("\n");
  163.     sb.append("}");
  164.     return sb.toString();
  165.   }

  166.   /**
  167.    * Convert the given object to string with each line indented by 4 spaces
  168.    * (except the first line).
  169.    */
  170.   private static String toIndentedString(java.lang.Object o) {
  171.     if (o == null) {
  172.       return "null";
  173.     }
  174.     return o.toString().replace("\n", "\n    ");
  175.   }
  176. }