Interaction.fromJson constructor

Interaction.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Interaction.fromJson(Map<String, dynamic> json) => Interaction(
      caller: Caller.fromJson(json["caller"]),
      readBy: json["readBy"] == null
          ? []
          : List<String>.from(json["readBy"]!.map((x) => x)),
      id: json["_id"],
      participants: json["participants"] == null
          ? []
          : List<Participant>.from(
              json["participants"]!.map((x) => Participant.fromJson(x))),
      agent: Agent.fromJson(json["agent"]),
      channel: json["channel"],
      extension: json["extension"],
      extraPayload: ExtraPayload.fromJson(json["extraPayload"]),
      createdAt: DateTime.parse(json["createdAt"]),
      updatedAt: DateTime.parse(json["updatedAt"]),
      lastMessage: json["lastMessage"] == null
          ? null
          : LastMessage.fromJson(json["lastMessage"]),
      emails: json["emails"] == null
          ? []
          : List<dynamic>.from(json["emails"]!.map((x) => x)),
      unread: json["unread"],
      interactionId: json["id"],
    );