import Client , { User , UserGroup , IUpsertUserReport } from "./../client" ; ( async ( ) => { try { const client = new Client ( ) ; const group = await client . createUserGroup ( "MyGroup" ) ; const user = await client . createUser ( { id : "MyUserId" , email : "mail@example.com" } ) ; await user . setDisplayName ( "My Display Name" ) ; await user . setQuota ( "5 GB" ) ; await user . setLanguage ( "en" ) ; const email = await user . getEmail ( ) ; await user . disable ( ) ; await user . enable ( ) ; await user . promoteToSuperAdmin ( ) ; await user . demoteFromSuperAdmin ( ) ; await user . resendWelcomeEmail ( ) ; await user . addToMemberUserGroup ( group ) ; const memberGroups = await user . getMemberUserGroups ( ) ; await group . getMemberUserIds ( ) ; await user . removeFromMemberUserGroup ( group ) ; await user . promoteToUserGroupSubadmin ( group ) ; const subadminGroups = await user . getSubadminUserGroups ( ) ; await group . getSubadminUserIds ( ) ; await user . demoteFromSubadminUserGroup ( group ) ; await user . delete ( ) ; await group . delete ( ) ; const report = await client . upsertUsers ( [ { id : "myUser1" , email : "myUser1@example.com" , enabled : false , memberGroups : [ "group1" , "group2" ] } , { id : "myUser2" , password : "mySecurePassword" , displayName : "My Name" , superAdmin : true , quota : "2 GB" } , ] ) ; } catch ( e ) { } } ) ( ) ;