OutOfBandMessage constructor
OutOfBandMessage({
- String? id,
- required String from,
- String? goalCode,
- String? goal,
- List<
DidcommProfiles> ? accept = const [DidcommProfiles.v2], - List<
Attachment> ? attachments, - String? replyUrl,
- List<
String> ? replyTo, - String? parentThreadId,
- String? threadId,
- List<
String> ? to, - DateTime? createdTime,
- DateTime? expiresTime,
- bool pleaseAck = false,
- FromPriorJWT? fromPrior,
- Map<
String, dynamic> ? additionalHeaders, - DidcommMessageTyp? typ,
- WebRedirect? webRedirect,
- ReturnRouteValue? returnRoute,
Implementation
OutOfBandMessage(
{String? id,
required String from,
this.goalCode,
this.goal,
this.accept = const [DidcommProfiles.v2],
List<Attachment>? attachments,
String? replyUrl,
List<String>? replyTo,
String? parentThreadId,
String? threadId,
List<String>? to,
DateTime? createdTime,
DateTime? expiresTime,
bool pleaseAck = false,
FromPriorJWT? fromPrior,
Map<String, dynamic>? additionalHeaders,
DidcommMessageTyp? typ,
WebRedirect? webRedirect,
ReturnRouteValue? returnRoute})
: super(
id: id ?? Uuid().v4(),
type: DidcommMessages.invitation.value,
body: {},
typ: DidcommMessageTyp.plain,
from: from,
attachments: attachments,
replyUrl: replyUrl,
replyTo: replyTo,
threadId: threadId,
parentThreadId: parentThreadId,
to: to,
createdTime: createdTime,
expiresTime: expiresTime,
pleaseAck: pleaseAck,
fromPrior: fromPrior,
additionalHeaders: additionalHeaders,
webRedirect: webRedirect,
returnRoute: returnRoute) {
if (goal != null) body['goal'] = goal;
if (goalCode != null) body['goal_code'] = goalCode;
List<String> tmp = [];
for (var p in accept!) {
tmp.add(p.value);
}
body['accept'] = tmp;
}