Map<String, Object?> toJson() => { 'record': record.toJson(), 'observedAt': observedAt, if (buildId != null) 'buildId': buildId, };