You might have. Aspirated gastric contents into your respiratory system, even down into lung. Get to a doctor so he can determine whether you did or not, it can be serious. You can get aspiration pneumonitis, a serious condition. But what is more concerning is why you vomited in the first place.
Vomit during sleep. This sounds like a significant medical emergency. I would hope that you have gotten health care by now. One can die if they inhale the vomit during their sleep.