WorkflowUpdate.fromJson constructor

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

Implementation

factory WorkflowUpdate.fromJson(Map<String, Object?> json) {
  return WorkflowUpdate(
    defaultStatusMappings: (json[r'defaultStatusMappings'] as List<Object?>?)
            ?.map((i) => StatusMigration.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    description: json[r'description'] as String?,
    id: json[r'id'] as String? ?? '',
    startPointLayout: json[r'startPointLayout'] != null
        ? WorkflowLayout.fromJson(
            json[r'startPointLayout']! as Map<String, Object?>)
        : null,
    statusMappings: (json[r'statusMappings'] as List<Object?>?)
            ?.map((i) => StatusMappingDTO.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    statuses: (json[r'statuses'] as List<Object?>?)
            ?.map((i) => StatusLayoutUpdate.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    transitions: (json[r'transitions'] as List<Object?>?)
            ?.map((i) => TransitionUpdateDTO.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    version: DocumentVersion.fromJson(
        json[r'version'] as Map<String, Object?>? ?? const {}),
  );
}