-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Feature: Implement Update User Details API (POST /api/users/:userId)
Background
This feature involves implementing the POST /api/users/:userId endpoint from the Umami API within the umami-kotlin library. This endpoint allows an authenticated user, typically an administrator or the user themselves, to update specific details for a user identified by userId. The request body will contain the fields to be updated.
Implementing this functionality is crucial for providing comprehensive user management capabilities within the umami-kotlin client. It will enable applications to modify user profiles, manage user roles, and update other user-specific information programmatically. This work directly contributes to fulfilling the "Umami API" section of the project roadmap, enhancing user-related functionalities.
Acceptance criteria
- GIVEN the Umami client is configured with a valid
baseUrland an authenticated user with appropriate permissions (e.g., an administrator, or the user whose ID matches:userId),
WHEN a request is made to update details for a specificuserIdwith valid new data via a new API method (e.g.,umami.users.updateUserDetails(userId, updateData)),
THEN the client successfully sends aPOSTrequest to/api/users/:userIdwith the update data
AND the method returns a successful response indicating the user details have been updated. - GIVEN the Umami client is configured with a valid
baseUrland an authenticated user,
WHEN a request is made to update details for auserIdfor which the authenticated user lacks permissions,
THEN the client successfully sends aPOSTrequest to/api/users/:userId
AND the method returns an error response (or throws an appropriateUmamiAuthExceptionorUmamiPermissionException) indicating access is denied. - GIVEN the Umami client is configured with a valid
baseUrland an authenticated user with permissions,
WHEN a request is made to update details for auserIdthat does not exist or with invalid update data (e.g., incorrect format, missing required fields),
THEN the client successfully sends aPOSTrequest to/api/users/:userId
AND the method returns an error response (or throws an appropriateUmamiNotFoundExceptionorUmamiValidationException) indicating the failure. - GIVEN the Umami client is configured,
WHEN a request is made to update user details and a network or server error occurs during the API call,
THEN the new API method throws an appropriate exception (e.g.,IOException,UmamiApiException). - GIVEN the
umami-kotlinlibrary is used in a project,
WHEN a developer initializes theUmamiclient usingUmami.create(),
THEN theUmamiinstance exposes a public method (e.g.,umami.users.updateUserDetails(userId: String, updateData: UserUpdateRequest)) to interact with thePOST /api/users/:userIdendpoint.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To Do