ApprovalDTO.fromJson constructor

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

Implementation

factory ApprovalDTO.fromJson(Map<String, Object?> json) {
  return ApprovalDTO(
    links: json[r'_links'] != null
        ? SelfLinkDTO.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
    approvers: (json[r'approvers'] as List<Object?>?)
            ?.map((i) =>
                ApproverDTO.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    canAnswerApproval: json[r'canAnswerApproval'] as bool? ?? false,
    completedDate: json[r'completedDate'] != null
        ? DateDTO.fromJson(json[r'completedDate']! as Map<String, Object?>)
        : null,
    createdDate: json[r'createdDate'] != null
        ? DateDTO.fromJson(json[r'createdDate']! as Map<String, Object?>)
        : null,
    finalDecision: json[r'finalDecision'] != null
        ? ApprovalDTOFinalDecision.fromValue(
            json[r'finalDecision']! as String)
        : null,
    id: json[r'id'] as String?,
    name: json[r'name'] as String?,
  );
}