RequestWillBeSentEvent.fromJson constructor

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

Implementation

factory RequestWillBeSentEvent.fromJson(Map<String, dynamic> json) {
  return RequestWillBeSentEvent(
    requestId: RequestId.fromJson(json['requestId'] as String),
    loaderId: LoaderId.fromJson(json['loaderId'] as String),
    documentURL: json['documentURL'] as String,
    request: RequestData.fromJson(json['request'] as Map<String, dynamic>),
    timestamp: MonotonicTime.fromJson(json['timestamp'] as num),
    wallTime: TimeSinceEpoch.fromJson(json['wallTime'] as num),
    initiator: Initiator.fromJson(json['initiator'] as Map<String, dynamic>),
    redirectHasExtraInfo: json['redirectHasExtraInfo'] as bool? ?? false,
    redirectResponse: json.containsKey('redirectResponse')
        ? ResponseData.fromJson(
            json['redirectResponse'] as Map<String, dynamic>)
        : null,
    type: json.containsKey('type')
        ? ResourceType.fromJson(json['type'] as String)
        : null,
    frameId: json.containsKey('frameId')
        ? page.FrameId.fromJson(json['frameId'] as String)
        : null,
    hasUserGesture: json.containsKey('hasUserGesture')
        ? json['hasUserGesture'] as bool
        : null,
  );
}