TrustTaskDocument<P> class

A single Trust Task document, per SPEC.md §4.2.

Optional members are nullable because every framework check in §7.2 turns on whether a member is present: a recipient of '' and an absent recipient lead to different verdicts, and collapsing them would make this runtime disagree with the Rust, TypeScript and Go ones.

Timestamps are strings, not DateTime, for the same parity reason. A malformed expiresAt must be reportable as malformedRequest by validateBasic; parsing it at decode time would instead throw, and the consumer would have no document to build an error response about.

Constructors

TrustTaskDocument({required String id, required String type, required P payload, String? threadId, String? parentThreadId, Ceremony? ceremony, String? issuer, String? recipient, String? issuedAt, String? expiresAt, Object? context, Proof? proof, Map<String, Object?> extra = const <String, Object?>{}})
const
TrustTaskDocument.fromJson(Map<String, dynamic> json, P payloadFromJson(Object? payload))
Decode a document whose payload is read by payloadFromJson.
factory

Properties

ceremony → Ceremony?
Records that this document is a step of a Trust Ceremony (§4.11).
final
context → Object?
The optional JSON-LD context (§4.6). Held untyped because §4.6 permits a string, an array or an object and the framework never interprets it.
final
expiresAt → String?
The instant after which the document is no longer valid (§4.2), RFC 3339.
final
extra → Map<String, Object?>
Top-level members this class does not name. §7.2 says a consumer SHOULD preserve but MUST NOT act upon them, and §7.1 asks a forwarding producer to carry them through — so they survive a round trip here rather than being dropped by the decoder.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Globally unique to this instance (§4.3).
final
issuedAt → String?
When the document was produced (§4.2), as RFC 3339.
final
issuer → String?
VID of the party responsible for the content (§4.8).
final
parentThreadId → String?
The threadId of the exchange containing this one, where this exchange is conducted inside another (§4.9.2).
final
payload → P
The task-specific body, whose structure is defined by the specification type names.
final
proof → Proof?
The optional Data Integrity proof binding the document to its issuer (§4.7).
final
recipient → String?
VID of the party expected to act on the document (§4.8).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
threadId → String?
Correlates this document with others in the same exchange (§4.9).
final
type → String
The Type URI identifying specification and version (§4.4).
final

Methods

copyWith({String? id, String? type, String? threadId, String? parentThreadId, String? issuer, String? recipient, String? issuedAt}) → TrustTaskDocument<P>
A copy with the named members replaced. Used by the response builders.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson(Object? payloadToJson(P payload)) → Map<String, dynamic>
Serialize, folding extra back in.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited