AuthenticationHttps.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 AuthenticationHttps  implements OneOfBaseCredenzialiCredenziali {
  27.  
  28.   @Schema(required = true, description = "")
  29.   private ModalitaAccessoEnum modalitaAccesso = 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 = "tipo", visible = true )
  33.   @com.fasterxml.jackson.annotation.JsonSubTypes({
  34.     @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = AuthenticationHttpsCertificato.class, name = "certificato"),
  35.     @com.fasterxml.jackson.annotation.JsonSubTypes.Type(value = AuthenticationHttpsConfigurazioneManuale.class, name = "configurazione-manuale")  })
  36.   private OneOfAuthenticationHttpsCertificato certificato = null;
  37.  
  38.   @Schema(description = "")
  39.   private List<AuthenticationHttpsBaseCertificato> certificati = null;
  40.  
  41.   @Schema(description = "")
  42.   private AuthenticationTokenBase token = null;
  43.  /**
  44.    * Get modalitaAccesso
  45.    * @return modalitaAccesso
  46.   **/
  47.   @Override
  48. @JsonProperty("modalita_accesso")
  49.   @NotNull
  50.   @Valid
  51.   public ModalitaAccessoEnum getModalitaAccesso() {
  52.     return this.modalitaAccesso;
  53.   }

  54.   public void setModalitaAccesso(ModalitaAccessoEnum modalitaAccesso) {
  55.     this.modalitaAccesso = modalitaAccesso;
  56.   }

  57.   public AuthenticationHttps modalitaAccesso(ModalitaAccessoEnum modalitaAccesso) {
  58.     this.modalitaAccesso = modalitaAccesso;
  59.     return this;
  60.   }

  61.  /**
  62.    * Get certificato
  63.    * @return certificato
  64.   **/
  65.   @JsonProperty("certificato")
  66.   @NotNull
  67.   @Valid
  68.   public OneOfAuthenticationHttpsCertificato getCertificato() {
  69.     return this.certificato;
  70.   }

  71.   public void setCertificato(OneOfAuthenticationHttpsCertificato certificato) {
  72.     this.certificato = certificato;
  73.   }

  74.   public AuthenticationHttps certificato(OneOfAuthenticationHttpsCertificato certificato) {
  75.     this.certificato = certificato;
  76.     return this;
  77.   }

  78.  /**
  79.    * Get certificati
  80.    * @return certificati
  81.   **/
  82.   @JsonProperty("certificati")
  83.   @Valid
  84.   public List<AuthenticationHttpsBaseCertificato> getCertificati() {
  85.     return this.certificati;
  86.   }

  87.   public void setCertificati(List<AuthenticationHttpsBaseCertificato> certificati) {
  88.     this.certificati = certificati;
  89.   }

  90.   public AuthenticationHttps certificati(List<AuthenticationHttpsBaseCertificato> certificati) {
  91.     this.certificati = certificati;
  92.     return this;
  93.   }

  94.   public AuthenticationHttps addCertificatiItem(AuthenticationHttpsBaseCertificato certificatiItem) {
  95.     this.certificati.add(certificatiItem);
  96.     return this;
  97.   }

  98.  /**
  99.    * Get token
  100.    * @return token
  101.   **/
  102.   @JsonProperty("token")
  103.   @Valid
  104.   public AuthenticationTokenBase getToken() {
  105.     return this.token;
  106.   }

  107.   public void setToken(AuthenticationTokenBase token) {
  108.     this.token = token;
  109.   }

  110.   public AuthenticationHttps token(AuthenticationTokenBase token) {
  111.     this.token = token;
  112.     return this;
  113.   }


  114.   @Override
  115.   public String toString() {
  116.     StringBuilder sb = new StringBuilder();
  117.     sb.append("class AuthenticationHttps {\n");
  118.    
  119.     sb.append("    modalitaAccesso: ").append(AuthenticationHttps.toIndentedString(this.modalitaAccesso)).append("\n");
  120.     sb.append("    certificato: ").append(AuthenticationHttps.toIndentedString(this.certificato)).append("\n");
  121.     sb.append("    certificati: ").append(AuthenticationHttps.toIndentedString(this.certificati)).append("\n");
  122.     sb.append("    token: ").append(AuthenticationHttps.toIndentedString(this.token)).append("\n");
  123.     sb.append("}");
  124.     return sb.toString();
  125.   }

  126.   /**
  127.    * Convert the given object to string with each line indented by 4 spaces
  128.    * (except the first line).
  129.    */
  130.   private static String toIndentedString(java.lang.Object o) {
  131.     if (o == null) {
  132.       return "null";
  133.     }
  134.     return o.toString().replace("\n", "\n    ");
  135.   }
  136. }