code: func (r *Rotation) CheckAndSetDefaults(clock clockwork.Clock) error {
  	switch r.Phase {
  	case "", RotationPhaseRollback, RotationPhaseUpdateClients, RotationPhaseUpdateServers:
  	default:
  		return trace.BadParameter("unsupported phase: %q", r.Phase)
  	}
  	switch r.Mode {
  	case "", RotationModeAuto, RotationModeManual:
  	default:
  		return trace.BadParameter("unsupported mode: %q", r.Mode)
  	}
  	switch r.State {
  	case "":
  		r.State = RotationStateStandby
  	case RotationStateStandby:
  	case RotationStateInProgress:
  		if r.CurrentID == "" {
  			return trace.BadParameter("set 'current_id' parameter for in progress rotation")
  		}
  		if r.Started.IsZero() {
  			return trace.BadParameter("set 'started' parameter for in progress rotation")
  		}
  	default:
  		return trace.BadParameter(
  			"unsupported rotation 'state': %q, supported states are: %q, %q",
  			r.State, RotationStateStandby, RotationStateInProgress)
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets default rotation parameters.