All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.reinkrul.nuts.vcr.v2.VerifiablePresentation Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
/*
 * Nuts Verifiable Credential API spec
 * API specification for common operations on Verifiable credentials. It allows the three roles, issuer, holder and verifier to issue, revoke, search, present and verify credentials. 
 *
 * The version of the OpenAPI document: 2.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package nl.reinkrul.nuts.vcr.v2;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.net.URI;

/**
 * Verifiable Presentation
 */
@ApiModel(description = "Verifiable Presentation")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-09-14T14:56:34.811142+02:00[Europe/Amsterdam]")
public class VerifiablePresentation {
  public static final String SERIALIZED_NAME_AT_CONTEXT = "@context";
  @SerializedName(SERIALIZED_NAME_AT_CONTEXT)
  private Object atContext = null;

  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  private URI id;

  public static final String SERIALIZED_NAME_TYPE = "type";
  @SerializedName(SERIALIZED_NAME_TYPE)
  private Object type = null;

  public static final String SERIALIZED_NAME_VERIFIABLE_CREDENTIAL = "verifiableCredential";
  @SerializedName(SERIALIZED_NAME_VERIFIABLE_CREDENTIAL)
  private Object verifiableCredential = null;

  public static final String SERIALIZED_NAME_HOLDER = "holder";
  @SerializedName(SERIALIZED_NAME_HOLDER)
  private URI holder;

  public static final String SERIALIZED_NAME_PROOF = "proof";
  @SerializedName(SERIALIZED_NAME_PROOF)
  private Object proof = null;


  public VerifiablePresentation atContext(Object atContext) {
    
    this.atContext = atContext;
    return this;
  }

   /**
   * An ordered set where the first item is a URI https://www.w3.org/2018/credentials/v1. It is used to define terms and help to express specific identifiers in a compact manner. 
   * @return atContext
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "[\"https://www.w3.org/2018/credentials/v1\"]", required = true, value = "An ordered set where the first item is a URI https://www.w3.org/2018/credentials/v1. It is used to define terms and help to express specific identifiers in a compact manner. ")

  public Object getAtContext() {
    return atContext;
  }


  public void setAtContext(Object atContext) {
    this.atContext = atContext;
  }


  public VerifiablePresentation id(URI id) {
    
    this.id = id;
    return this;
  }

   /**
   * URI that is used to unambiguously refer to an object, such as a person, product, or organization.
   * @return id
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "https://example.edu/credentials/1872,", value = "URI that is used to unambiguously refer to an object, such as a person, product, or organization.")

  public URI getId() {
    return id;
  }


  public void setId(URI id) {
    this.id = id;
  }


  public VerifiablePresentation type(Object type) {
    
    this.type = type;
    return this;
  }

   /**
   * A single string or array of strings. Values indicate the type of object. It should contain `VerifiablePresentation`. Each type must be defined in the @context.
   * @return type
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "VerifiablePresentation", required = true, value = "A single string or array of strings. Values indicate the type of object. It should contain `VerifiablePresentation`. Each type must be defined in the @context.")

  public Object getType() {
    return type;
  }


  public void setType(Object type) {
    this.type = type;
  }


  public VerifiablePresentation verifiableCredential(Object verifiableCredential) {
    
    this.verifiableCredential = verifiableCredential;
    return this;
  }

   /**
   * VerifiableCredential is composed of a list containing one or more verifiable credentials, in a cryptographically verifiable format. 
   * @return verifiableCredential
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "{\"$ref\":\"#/components/schemas/VerifiableCredential\"}", value = "VerifiableCredential is composed of a list containing one or more verifiable credentials, in a cryptographically verifiable format. ")

  public Object getVerifiableCredential() {
    return verifiableCredential;
  }


  public void setVerifiableCredential(Object verifiableCredential) {
    this.verifiableCredential = verifiableCredential;
  }


  public VerifiablePresentation holder(URI holder) {
    
    this.holder = holder;
    return this;
  }

   /**
   * URI of the entity that is generating the presentation.
   * @return holder
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "did:nuts:123", value = "URI of the entity that is generating the presentation.")

  public URI getHolder() {
    return holder;
  }


  public void setHolder(URI holder) {
    this.holder = holder;
  }


  public VerifiablePresentation proof(Object proof) {
    
    this.proof = proof;
    return this;
  }

   /**
   * Cryptographic proofs that can be used to detect tampering and verify the authorship of a credential or presentation. An embedded proof is a mechanism where the proof is included in the data, such as a Linked Data Signature. 
   * @return proof
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(example = "{\"$ref\":\"#/components/schemas/EmbeddedProof\"}", value = "Cryptographic proofs that can be used to detect tampering and verify the authorship of a credential or presentation. An embedded proof is a mechanism where the proof is included in the data, such as a Linked Data Signature. ")

  public Object getProof() {
    return proof;
  }


  public void setProof(Object proof) {
    this.proof = proof;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VerifiablePresentation verifiablePresentation = (VerifiablePresentation) o;
    return Objects.equals(this.atContext, verifiablePresentation.atContext) &&
        Objects.equals(this.id, verifiablePresentation.id) &&
        Objects.equals(this.type, verifiablePresentation.type) &&
        Objects.equals(this.verifiableCredential, verifiablePresentation.verifiableCredential) &&
        Objects.equals(this.holder, verifiablePresentation.holder) &&
        Objects.equals(this.proof, verifiablePresentation.proof);
  }

  @Override
  public int hashCode() {
    return Objects.hash(atContext, id, type, verifiableCredential, holder, proof);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VerifiablePresentation {\n");
    sb.append("    atContext: ").append(toIndentedString(atContext)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    verifiableCredential: ").append(toIndentedString(verifiableCredential)).append("\n");
    sb.append("    holder: ").append(toIndentedString(holder)).append("\n");
    sb.append("    proof: ").append(toIndentedString(proof)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy