Prince William has been given the keys to the city of Rio de Janeiro.