Cognito Pre-Token Generation Lambda sample

Anyone has any sample in .net/java?

I’m thinking of looking up the user against my custom rules (stored in dynamodb) and customize the claims.

Thanks.