In the Mandate of Heaven concept who was the ruler

The ruler in the Mandate of Heaven concept in ancient China was believed to be appointed by Heaven, or the gods, and was seen as a legitimate and just ruler who had the divine right to govern the people. The concept originated during the Zhou dynasty (1046-256 BCE) and was later adopted by subsequent dynasties. The ruler was expected to govern with virtue, uphold the well-being of the people, and maintain harmony and stability. If a ruler failed to do so, it was believed that they had lost the mandate, and could be overthrown by a more virtuous and worthy ruler.