Adding Light programmatically

Hi,
How to add various kinds of lights (point, directional, spot) programmatically?

Thanks in advance.

The same process when you add another entities.
Please read the doc/API for further info.

Thanks.