Interface UserManagement
-
- All Implemented Interfaces:
public interface UserManagementThe UserManagement interface provides methods for retrieving an authenticated user and deleting authentication factors from an authenticated user.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classUserManagement.UpdateParamsData class used for wrapping parameters used with User updates
public final classUserManagement.SearchParamsData class used for wrapping parameters used for searching Users
-
Method Summary
Modifier and Type Method Description abstract UnitonChange(Function1<StytchObjectInfo<UserData>, Unit> callback)Assign a callback that will be called when the user data changes abstract StytchResult<UserData>getUser()Fetches a user from the current session abstract UnitgetUser(Function1<StytchResult<UserData>, Unit> callback)Fetches a user from the current session abstract CompletableFuture<StytchResult<UserData>>getUserCompletable()Fetches a user from the current session abstract UserDatagetSyncUser()Get user from memory without making a network call abstract StytchResult<DeleteAuthenticationFactorData>deleteFactor(UserAuthenticationFactor factor)Deletes a UserAuthenticationFactor from the currently authenticated user abstract UnitdeleteFactor(UserAuthenticationFactor factor, Function1<StytchResult<DeleteAuthenticationFactorData>, Unit> callback)Deletes a UserAuthenticationFactor from the currently authenticated user abstract CompletableFuture<StytchResult<DeleteAuthenticationFactorData>>deleteFactorCompletable(UserAuthenticationFactor factor)Deletes a UserAuthenticationFactor from the currently authenticated user abstract StytchResult<UpdateUserResponseData>update(UserManagement.UpdateParams params)Updates the currently authenticated user abstract Unitupdate(UserManagement.UpdateParams params, Function1<StytchResult<UpdateUserResponseData>, Unit> callback)Updates the currently authenticated user abstract CompletableFuture<StytchResult<UpdateUserResponseData>>updateCompletable(UserManagement.UpdateParams params)Updates the currently authenticated user abstract StytchResult<UserSearchResponseData>search(UserManagement.SearchParams params)Searches for the specified user abstract Unitsearch(UserManagement.SearchParams params, Function1<StytchResult<UserSearchResponseData>, Unit> callback)Searches for the specified user abstract CompletableFuture<StytchResult<UserSearchResponseData>>searchCompletable(UserManagement.SearchParams params)Searches for the specified user abstract StateFlow<StytchObjectInfo<UserData>>getOnChange()Exposes a flow of user data -
-
Method Detail
-
onChange
abstract Unit onChange(Function1<StytchObjectInfo<UserData>, Unit> callback)
Assign a callback that will be called when the user data changes
-
getUser
abstract StytchResult<UserData> getUser()
Fetches a user from the current session
- Returns:
UserResponse
-
getUser
abstract Unit getUser(Function1<StytchResult<UserData>, Unit> callback)
Fetches a user from the current session
- Parameters:
callback- A callback that receives a UserResponse
-
getUserCompletable
abstract CompletableFuture<StytchResult<UserData>> getUserCompletable()
Fetches a user from the current session
- Returns:
UserResponse
-
getSyncUser
abstract UserData getSyncUser()
Get user from memory without making a network call
- Returns:
UserData
-
deleteFactor
abstract StytchResult<DeleteAuthenticationFactorData> deleteFactor(UserAuthenticationFactor factor)
Deletes a UserAuthenticationFactor from the currently authenticated user
- Returns:
DeleteFactorResponse
-
deleteFactor
abstract Unit deleteFactor(UserAuthenticationFactor factor, Function1<StytchResult<DeleteAuthenticationFactorData>, Unit> callback)
Deletes a UserAuthenticationFactor from the currently authenticated user
- Parameters:
callback- A callback that receives a DeleteFactorResponse
-
deleteFactorCompletable
abstract CompletableFuture<StytchResult<DeleteAuthenticationFactorData>> deleteFactorCompletable(UserAuthenticationFactor factor)
Deletes a UserAuthenticationFactor from the currently authenticated user
- Returns:
DeleteFactorResponse
-
update
abstract StytchResult<UpdateUserResponseData> update(UserManagement.UpdateParams params)
Updates the currently authenticated user
- Parameters:
params- required to udpate the user- Returns:
UpdateUserResponse
-
update
abstract Unit update(UserManagement.UpdateParams params, Function1<StytchResult<UpdateUserResponseData>, Unit> callback)
Updates the currently authenticated user
- Parameters:
params- required to udpate the usercallback- a callback that receives an UpdateUserResponse
-
updateCompletable
abstract CompletableFuture<StytchResult<UpdateUserResponseData>> updateCompletable(UserManagement.UpdateParams params)
Updates the currently authenticated user
- Parameters:
params- required to udpate the user- Returns:
UpdateUserResponse
-
search
abstract StytchResult<UserSearchResponseData> search(UserManagement.SearchParams params)
Searches for the specified user
- Parameters:
params- required for searching users- Returns:
SearchUserResponse
-
search
abstract Unit search(UserManagement.SearchParams params, Function1<StytchResult<UserSearchResponseData>, Unit> callback)
Searches for the specified user
- Parameters:
params- required for searching userscallback- a callback that receives a SearchUserResponse
-
searchCompletable
abstract CompletableFuture<StytchResult<UserSearchResponseData>> searchCompletable(UserManagement.SearchParams params)
Searches for the specified user
- Parameters:
params- required for searching users- Returns:
SearchUserResponse
-
getOnChange
abstract StateFlow<StytchObjectInfo<UserData>> getOnChange()
Exposes a flow of user data
-
-
-
-