SentryTraceContext.fromJson constructor

SentryTraceContext.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory SentryTraceContext.fromJson(Map<String, dynamic> data) {
  final json = AccessAwareMap(data);
  return SentryTraceContext(
    operation: json['op'] as String,
    spanId: SpanId.fromId(json['span_id'] as String),
    parentSpanId: json['parent_span_id'] == null
        ? null
        : SpanId.fromId(json['parent_span_id'] as String),
    traceId: SentryId.fromId(json['trace_id'] as String),
    replayId: json['replay_id'] == null
        ? null
        : SentryId.fromId(json['replay_id'] as String),
    description: json['description'] as String?,
    status: json['status'] == null
        ? null
        : SpanStatus.fromString(json['status'] as String),
    sampled: true,
    origin: json['origin'] == null ? null : json['origin'] as String?,
    data: json['data'] == null ? null : json['data'] as Map<String, dynamic>,
    unknown: json.notAccessed(),
  );
}