Its grammatical function is indirect object of got . The direct object is what . This may be easier to see in a statement: I got you a shovel for your birthday.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.