RuleSet.fromJson constructor

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

Implementation

factory RuleSet.fromJson(Map<String, dynamic> json) {
  return RuleSet(
    id: RuleSetId.fromJson(json['id'] as String),
    loaderId: network.LoaderId.fromJson(json['loaderId'] as String),
    sourceText: json['sourceText'] as String,
    backendNodeId: json.containsKey('backendNodeId')
        ? dom.BackendNodeId.fromJson(json['backendNodeId'] as int)
        : null,
    url: json.containsKey('url') ? json['url'] as String : null,
    requestId: json.containsKey('requestId')
        ? network.RequestId.fromJson(json['requestId'] as String)
        : null,
    errorType: json.containsKey('errorType')
        ? RuleSetErrorType.fromJson(json['errorType'] as String)
        : null,
  );
}