If it is aversive to the animal and discourages behavior, it is a punishment. If it seems aversive to you but is not aversive to the animal, then it is not an effective punishment. In fact, technically, it's not even a punishment.
2015, Ilona Rodan, Sarah Heath, editors, Feline Behavioral Health and Welfare, Elsevier Health Sciences, page 47