Seems to me it can be a predicate (verb), direct object, or indirect object.
You can write a sentence with it in any of those places.
Verb . . . I hug you.
Direct object . . . I gave you a hug.
Indirect object . . . You recoiled at the aggressiveness of the hug.