def METHOD_NAME(self, task_token: str, details: str | None = None) -> dict[str, Any] | None:
    """Records activity task heartbeat
    :param  task_token: canceled activity task token
    :param  details: provided details about task progress
    """
    try:
        return self.connection.record_activity_task_heartbeat(
            task_token,
            format.heartbeat_details(details),
        )
    except boto.exception.SWFResponseError as e:
        message = self.get_error_message(e)
        if e.error_code == "UnknownResourceFault":
            raise DoesNotExistError(
                f"Unable to send heartbeat with token={task_token}",
                message,
            )
        if e.error_code == "ThrottlingException":
            raise RateLimitExceededError(
                f"Rate exceeded when sending heartbeat with token={task_token}",
                message,
            )
        raise ResponseError(message)