SafetyResult.fromJson constructor

SafetyResult.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory SafetyResult.fromJson(Map<String, Object?> json) => SafetyResult(
      contentHash: json["content_hash"] as String,
      links: json["links"] == null
          ? null
          : (json["links"] as List)
              .map(
                (item) => ScannedLink.fromJson(
                  (item as Map).cast<String, Object?>(),
                ),
              )
              .toList(),
      normalizedText: json["normalized_text"] as String,
      quarantineNotes: json["quarantine_notes"] == null
          ? null
          : json["quarantine_notes"] as String,
      reasonCodes: json["reason_codes"] == null
          ? null
          : (json["reason_codes"] as List)
              .map((item) => item as String)
              .toList(),
      sanitizedHtml: json["sanitized_html"] == null
          ? null
          : json["sanitized_html"] as String,
      scanner: json["scanner"] as String,
      status: inttegro_shared.ContentSafetyStatus.fromJson(json["status"]),
    );