VisitorConversationDto.fromJson constructor

VisitorConversationDto.fromJson(
  1. Json j
)

Parses the wire shape.

Implementation

factory VisitorConversationDto.fromJson(Json j) => VisitorConversationDto(
  id: strOr(j, 'id'),
  siteId: strOr(j, 'site_id'),
  status: ConversationStatus.parse(str(j, 'status')),
  seq: intOr(j, 'seq'),
  visitorUnread: intOr(j, 'visitor_unread'),
  lastMessageAt: dateOf(j, 'last_message_at'),
  lastMessagePreview: str(j, 'last_message_preview'),
  lastMessageSenderType: j['last_message_sender_type'] == null
      ? null
      : SenderType.parse(str(j, 'last_message_sender_type')),
  firstResponseAt: dateOf(j, 'first_response_at'),
  resolvedAt: dateOf(j, 'resolved_at'),
  subject: str(j, 'subject'),
  createdAt: dateOf(j, 'created_at'),
  updatedAt: dateOf(j, 'updated_at'),
  agent: mapOf(j, 'agent') == null ? null : AgentSummary.fromJson(mapOf(j, 'agent')!),
  raw: j,
);