Validate AdvEnum & return an InvalidInput on error

Raise a relevant exception of InvalidInput while validating if
the input to AdvEnum is not one of what is expected.

Closes-bug: #1320430
Change-Id: I48f014cc09e7d88e9b0f02fb8e9cf45772178b2c
(cherry picked from commit 7cf60e2a3b54b7a763434f65cb045b80074addf1)
Merge "Validate AdvEnum & return an InvalidInput on error" into stable/juno