Very likely your dragon has aspirated some water (partly downed) …. keep a very close eye on the dragon since it's obviously in respiratory distress (most likely) and keep it warm including overnight to help the it's lungs dry , when it's asleep , place it on slight slope with it's head lower than it's bottom , this will also help some water drain out of lungs overnight.
If still in distress tomorrow you need a vet to check the dragon's lungs. Can very easily develop a very serious respiratory infection from having water in the lungs.
Essentially
>> monitor very closely
>> comfort
>> keep warm (daytime temperatures overnight as well)
>> help lungs drain by placing on a gentle slope while overnight.
>> vet assessment a very wise move.