RequestPausedEvent.fromJson constructor

RequestPausedEvent.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory RequestPausedEvent.fromJson(Map<String, dynamic> json) {
  return RequestPausedEvent(
    requestId: RequestId.fromJson(json['requestId'] as String),
    request:
        network.RequestData.fromJson(json['request'] as Map<String, dynamic>),
    frameId: page.FrameId.fromJson(json['frameId'] as String),
    resourceType:
        network.ResourceType.fromJson(json['resourceType'] as String),
    responseErrorReason: json.containsKey('responseErrorReason')
        ? network.ErrorReason.fromJson(json['responseErrorReason'] as String)
        : null,
    responseStatusCode: json.containsKey('responseStatusCode')
        ? json['responseStatusCode'] as int
        : null,
    responseStatusText: json.containsKey('responseStatusText')
        ? json['responseStatusText'] as String
        : null,
    responseHeaders: json.containsKey('responseHeaders')
        ? (json['responseHeaders'] as List)
            .map((e) => HeaderEntry.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    networkId: json.containsKey('networkId')
        ? network.RequestId.fromJson(json['networkId'] as String)
        : null,
    redirectedRequestId: json.containsKey('redirectedRequestId')
        ? RequestId.fromJson(json['redirectedRequestId'] as String)
        : null,
  );
}