Alternative to getLabelManager() for Confluence DC version 9.0.0+

I’d used the LabelManager() in Confluence 8.0.0+ in a user macro, but now the same macro that used the getLabelManager() function doesn’t work anymore. Has anyone found an alternative to this?

Deprecated list