RequestCredential constructor
RequestCredential({
- String? id,
- String? goalCode,
- String? comment,
- List<
LdProofVcDetail> ? detail, - VerifiablePresentation? credentialApplication,
- String? replyUrl,
- List<
String> ? replyTo, - String? parentThreadId,
- String? threadId,
- String? from,
- List<
String> ? to, - DateTime? createdTime,
- DateTime? expiresTime,
- bool pleaseAck = false,
- FromPriorJWT? fromPrior,
- Map<
String, dynamic> ? additionalHeaders, - WebRedirect? webRedirect,
- ReturnRouteValue? returnRoute,
- DidcommMessageTyp? typ,
Implementation
RequestCredential(
{String? id,
this.goalCode,
this.comment,
this.detail,
this.credentialApplication,
super.replyUrl,
super.replyTo,
super.parentThreadId,
super.threadId,
super.from,
List<String>? super.to,
super.createdTime,
super.expiresTime,
super.pleaseAck,
super.fromPrior,
super.additionalHeaders,
super.webRedirect,
super.returnRoute,
super.typ})
: super(
type: DidcommMessages.requestCredential,
id: id ?? Uuid().v4(),
body: {}) {
if (comment != null) body['comment'] = comment;
if (goalCode != null) body['goal_code'] = goalCode;
if (detail != null) {
attachments = [];
for (var a in detail!) {
attachments!.add(Attachment(
data: AttachmentData(json: a.toJson()),
id: Uuid().v4(),
format: AttachmentFormat.ldProofVcDetail,
mediaType: 'application/json'));
}
}
if (credentialApplication != null) {
attachments ??= [];
attachments!.add(Attachment(
data: AttachmentData(json: credentialApplication!.toJson()),
id: Uuid().v4(),
format: AttachmentFormat.credentialApplication,
mediaType: 'application/json'));
}
}