CustomerRequestDTO.fromJson constructor

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

Implementation

factory CustomerRequestDTO.fromJson(Map<String, Object?> json) {
  return CustomerRequestDTO(
    expands: (json[r'_expands'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    links: json[r'_links'] != null
        ? CustomerRequestLinkDTO.fromJson(
            json[r'_links']! as Map<String, Object?>)
        : null,
    actions: json[r'actions'] != null
        ? CustomerRequestActionsDTO.fromJson(
            json[r'actions']! as Map<String, Object?>)
        : null,
    attachments: json[r'attachments'] != null
        ? PagedDTOAttachmentDTO.fromJson(
            json[r'attachments']! as Map<String, Object?>)
        : null,
    comments: json[r'comments'] != null
        ? PagedDTOCommentDTO.fromJson(
            json[r'comments']! as Map<String, Object?>)
        : null,
    createdDate: json[r'createdDate'] != null
        ? DateDTO.fromJson(json[r'createdDate']! as Map<String, Object?>)
        : null,
    currentStatus: json[r'currentStatus'] != null
        ? CustomerRequestStatusDTO.fromJson(
            json[r'currentStatus']! as Map<String, Object?>)
        : null,
    issueId: json[r'issueId'] as String?,
    issueKey: json[r'issueKey'] as String?,
    participants: json[r'participants'] != null
        ? PagedDTOUserDTO.fromJson(
            json[r'participants']! as Map<String, Object?>)
        : null,
    reporter: json[r'reporter'] != null
        ? UserDTO.fromJson(json[r'reporter']! as Map<String, Object?>)
        : null,
    requestFieldValues: (json[r'requestFieldValues'] as List<Object?>?)
            ?.map((i) => CustomerRequestFieldValueDTO.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    requestType: json[r'requestType'] != null
        ? RequestTypeDTO.fromJson(
            json[r'requestType']! as Map<String, Object?>)
        : null,
    requestTypeId: json[r'requestTypeId'] as String?,
    serviceDesk: json[r'serviceDesk'] != null
        ? ServiceDeskDTO.fromJson(
            json[r'serviceDesk']! as Map<String, Object?>)
        : null,
    serviceDeskId: json[r'serviceDeskId'] as String?,
    sla: json[r'sla'] != null
        ? PagedDTOSlaInformationDTO.fromJson(
            json[r'sla']! as Map<String, Object?>)
        : null,
    status: json[r'status'] != null
        ? PagedDTOCustomerRequestStatusDTO.fromJson(
            json[r'status']! as Map<String, Object?>)
        : null,
  );
}