IssueSecuritySchemeManager, how do you set default security level?

I’m trying to update issue security level and scheme programmatically.

There are two updateScheme() methods in the manager class: IssueSecurityLevelScheme (Atlassian Jira - Server 8.21.0 API)

One is deprecated which takes a GenericValue object.
One is not deprecated, which takes a Scheme object.

But unlike the get APIs that returns IssueSecurityLevelScheme objects, Scheme object does not have an obvious way to set default security level. It only takes id, name, description and entity (which seems to be empty in all cases).

While the code seems to be using the GenericValue version and set “defaultlevel” to a long ID of the level.

How do you programmatically set issue security scheme’s security level, if not using the deprecated GenericValue API?