This PR is built on top of #23841 and I would like to have some suggestions for my first contribution to the cpp source code.
In particular, how to return the InitError and there is some particular global variable to manage the deprecation process?
as TODO I would like to introduce additional unite tests to cover this new state