import { TrustedIssuerModel } from './TrustedIssuerModel' ; import { BaseAttestationModel } from './BaseAttestationModel' ; import { InputClaimModel } from './InputClaimModel' ; /**
 * Represents a Verifiable Presentation in the input file
 */ export class VerifiablePresentationAttestationModel extends BaseAttestationModel { param credentialType param validityInterval param issuers param endorsers param contracts param mapping param encrypted param claims param required param id constructor ( public credentialType ? , public validityInterval ? , public issuers ? , public endorsers ? , public contracts ? , mapping ? , encrypted = false , claims ? , required = false , id ? ) { super ( mapping , encrypted , claims , required , id ) ; } /**
     * Gets the name of the attestation
     */ get name ( ) : string { return this . credentialType ! ; } toJSON ( ) { const result = super . toJSON ( ) ; result . credentialType = this . credentialType ; result . validityInterval = this . validityInterval ; result . issuers = this . issuers ; result . endorsers = this . endorsers ; result . contracts = this . contracts ; return result ; } param input populateFrom ( input ) { super . populateFrom ( input ) ; this . credentialType = input . credentialType ; this . validityInterval = input . validityInterval ; this . contracts = input . contracts ; if ( input . issuers ) { const arr = Array . from ( input . issuers ) ; this . issuers = arr . map ( VerifiablePresentationAttestationModel . createTrustedIssuer ) ; } if ( input . endorsers ) { const arr = Array . from ( input . endorsers ) ; this . endorsers = arr . map ( VerifiablePresentationAttestationModel . createTrustedIssuer ) ; } } private static createTrustedIssuer ( issuer ) { const t = new TrustedIssuerModel ( ) ; t . populateFrom ( issuer ) ; return t ; } param claims protected createForInput ( claims ) { return new VerifiablePresentationAttestationModel ( this . credentialType , this . validityInterval , this . issuers , this . endorsers , this . contracts , undefined , this . encrypted , claims , this . required ) ; } }