Best way to convert a UserGetSingleton to User SDK 21

I’m confused by the getUser call

It is now returning a new UserGetSingleton object.
Most of the methods seem to still use the User object. Seems like a miss match now.
I can get a user but can’t pass it in anywhere.

I was ready to write some function that would convert/copy over the UserSinglton back to the User, but I can’t set the userId. I can only get it.

Any idea what to do here?

  1. How do a get a user (either by id or username) that I can use in other calls?
  2. Any way to convert the user?

Hello,

Can you try,

UserGetSingleton userGetSingleton = userApi.getUser(email, null, "true");

// convert UserGetSingleton object type to User object type
User convertedUser = userApi.getApiClient().getObjectMapper().convertValue(userGetSingleton, User.class);