ContentStateBulkSetTaskUpdate.fromJson constructor

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

Implementation

factory ContentStateBulkSetTaskUpdate.fromJson(Map<String, Object?> json) {
  return ContentStateBulkSetTaskUpdate(
    set: (json[r'set'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    failed: (json[r'failed'] as List<Object?>?)
            ?.map((i) => ContentStateFailure.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    percentage: (json[r'percentage'] as num?)?.toInt() ?? 0,
    message: json[r'message'] as String?,
    state: json[r'state'] != null
        ? ContentState.fromJson(json[r'state']! as Map<String, Object?>)
        : null,
    success: json[r'success'] as bool? ?? false,
  );
}