toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'type': kType,
      'mission_id': missionId,
      'step_index': stepIndex,
      'success': success,
      'evidence': [
        for (final e in evidence) VerificationEvidenceCodec.toWire(e),
      ],
      'timestamp': timestamp.toIso8601String(),
      if (failureReason != null) 'failure_reason': failureReason,
      if (value != null && value!.isNotEmpty) 'value': value,
      if (strategy != null && strategy!.isNotEmpty) 'strategy': strategy,
      if (requestedStableId != null && requestedStableId!.isNotEmpty)
        'requested_stable_id': requestedStableId,
      if (requestedText != null && requestedText!.isNotEmpty)
        'requested_text': requestedText,
      if (actedStableId != null && actedStableId!.isNotEmpty)
        'acted_stable_id': actedStableId,
      if (actedRole != null && actedRole!.isNotEmpty) 'acted_role': actedRole,
      if (redirected != null) 'redirected': redirected,
      if (matchSource != null && matchSource!.isNotEmpty)
        'match_source': matchSource,
      if (verified != null) 'verified': verified,
      if (valueMatched != null) 'value_matched': valueMatched,
    };