toJSON method

Map<String, dynamic> toJSON()

Implementation

Map<String, dynamic> toJSON() {
  return <String, dynamic>{
    'isPrivate': isPrivate,
    'lastMessage': lastMessage?.toJSON(),
    'profileIds': profileIds,
    'createdTime': createdTime,
    'handlerMode': handlerMode,
    'needsHuman': needsHuman,
    'assignedSupportId': assignedSupportId,
    'lastHumanAt': lastHumanAt,
    'lastUserAt': lastUserAt,
    'isSupportRoom': isSupportRoom,
    'isTeamRoom': isTeamRoom,
    'csatScore': csatScore,
    'csatAt': csatAt,
    'supportTopic': supportTopic,
    'summaryEmailedAt': summaryEmailedAt,
    if (roomKind != InboxRoomKind.direct) 'roomKind': roomKind.name,
    if (name.isNotEmpty) 'name': name,
    if (photoUrl.isNotEmpty) 'photoUrl': photoUrl,
    if (description.isNotEmpty) 'description': description,
    if (adminIds.isNotEmpty) 'adminIds': adminIds,
    if (pinnedByProfileIds.isNotEmpty)
      'pinnedByProfileIds': pinnedByProfileIds,
    if (mutedByProfileIds.isNotEmpty) 'mutedByProfileIds': mutedByProfileIds,
    if (transportMode != 'cloud') 'transportMode': transportMode,
    if (groupKeyId.isNotEmpty) 'groupKeyId': groupKeyId,
    if (geohashZone.isNotEmpty) 'geohashZone': geohashZone,
  };
}