How TO GET A Master ball in Pokemon diamond?

The boss of Team Galactic (Cyrus) gives you the Master Ball after you beat him in the Team Galactic hideout in Veilstone City. This happens after you beat Candice in the Snowpoint City Gym (7th Gym).