Dynamics of an optical resonator determined by its iterative map of beam parameters