Class UserEndpoints
java.lang.Object
masecla.modrinth4j.endpoints.user.UserEndpoints
This class is used to represent the endpoints for users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangeProfilePicture(String id, File file) Modifies the profile picture of a user by their IDchangeProfilePicture(String id, InputStream stream, String filename) Modifies the profile picture of a user by their IDdeleteUser(String id) Deletes a user by their IDGets the notifications of a user by their IDgetSelf()Gets the current user from the APIGets a user by their ID or usernameGets multiple users by their IDs.Gets multiple users by their IDs.Gets the followed projects of a user by their IDGets the projects of a user by their IDmodifyUser(String id, ModifyUser.ModifyUserRequest request) Modifies a user by their IDReports a project, user, or version
-
Constructor Details
-
UserEndpoints
public UserEndpoints()
-
-
Method Details
-
getUser
Gets a user by their ID or username- Parameters:
id- - The ID or username of the user- Returns:
- - The user
-
getUser
Gets multiple users by their IDs. Note: This will only work with IDs, not usernames. unlikegetUser(String)- Parameters:
ids- - The IDs of the users- Returns:
- - The users
-
getUser
Gets multiple users by their IDs. Note: This will only work with IDs, not usernames. unlikegetUser(String)- Parameters:
ids- - The IDs of the users- Returns:
- - The users
-
modifyUser
Modifies a user by their ID- Parameters:
id- - The ID of the userrequest- - The request to send- Returns:
- - A
CompletableFuturethat will return anEmptyResponsewhen complete
-
deleteUser
Deletes a user by their ID- Parameters:
id- - The ID of the user- Returns:
- - A
CompletableFuturethat will return anEmptyResponsewhen complete
-
getSelf
Gets the current user from the API- Returns:
- - The current user
-
changeProfilePicture
public CompletableFuture<EmptyResponse> changeProfilePicture(String id, File file) throws FileNotFoundException Modifies the profile picture of a user by their ID- Parameters:
id- - The ID of the userfile- - The file to use as the profile picture- Returns:
- - A
CompletableFuturethat will return anEmptyResponsewhen complete - Throws:
FileNotFoundException- - If the file cannot be found
-
changeProfilePicture
public CompletableFuture<EmptyResponse> changeProfilePicture(String id, InputStream stream, String filename) Modifies the profile picture of a user by their ID- Parameters:
id- - The ID of the userstream- - The stream to use as the profile picturefilename- - The filename of the profile picture- Returns:
- - A
CompletableFuturethat will return anEmptyResponsewhen complete
-
getUserProjects
Gets the projects of a user by their ID- Parameters:
id- - The ID of the user- Returns:
- - A
CompletableFuturethat will return aListofProjects when complete
-
getUserFollowedProjects
Gets the followed projects of a user by their ID- Parameters:
id- - The ID of the user- Returns:
- - A
CompletableFuturethat will return aListofProjects when complete
-
getNotifications
Gets the notifications of a user by their ID- Parameters:
id- - The ID of the user- Returns:
- - A
CompletableFuturethat will return aListofModrinthUserNotifications when complete
-
reportProjectUserOrVersion
public CompletableFuture<ReportProjectUserOrVersion.ReportProjectUserOrVersionResponse> reportProjectUserOrVersion(ReportProjectUserOrVersion.ReportProjectUserOrVersionRequest request) Reports a project, user, or version- Parameters:
request- - The request to send- Returns:
- - A
CompletableFuturethat will return aReportProjectUserOrVersion.ReportProjectUserOrVersionResponsewhen complete
-