Class ProjectEndpoints
java.lang.Object
masecla.modrinth4j.endpoints.project.ProjectEndpoints
This class is used to represent the project endpoints.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis endpoint is used to modify properties about projects in bulk.changeProjectIcon(String projectId, File file) This endpoint is used to change the icon of a project.changeProjectIcon(String projectId, InputStream stream, String fileName) This endpoint is used to change the icon of a project.checkSlugAvailability(String slug) This endpoint is used to check slug availability.create(CreateProject.CreateProjectRequest request) This endpoint will create a project based on the request.createGalleryImage(String slug, CreateGalleryImage.CreateGalleryImageRequest request) This endpoint is used to create a gallery image for a project.This endpoint is used to delete a project by its ID.deleteGalleryImage(String slug, String imageUrl) This endpoint is used to delete a gallery image for a project.deleteProjectIcon(String projectId) This endpoint is used to delete a project icon.followProject(String slug) This endpoint is used to follow a project.This endpoint is used to fetch a project by its ID.This endpoint is used to fetch a list of projects by their IDs.This endpoint is used to fetch a list of projects by their IDs.getProjectDependencies(String slug) This endpoint is used to get the dependencies for a project.getProjectIdBySlug(String slug) This endpoint is used to get the project ID from a sluggetRandomProjects(int count) This endpoint is used to get a list of random projectsmodify(String project, ModifyProject.ProjectModifications request) This endpoint is used to modify a project by its ID.modifyGalleryImage(String slug, ModifyGalleryImage.ModifyGalleryImageRequest request) This endpoint is used to modify a gallery image for a project.scheduleProject(String projectId, ScheduleProject.ScheduleProjectRequest request) This endpoint is used to schedule a project.unfollowProject(String slug) This endpoint is used to unfollow a project.
-
Constructor Details
-
ProjectEndpoints
public ProjectEndpoints()
-
-
Method Details
-
get
This endpoint is used to fetch a project by its ID.- Parameters:
project- - project The ID of the project to fetch.- Returns:
- A
CompletableFuturethat will return the project.
-
get
This endpoint is used to fetch a list of projects by their IDs.- Parameters:
projects- - The IDs of the projects to fetch.- Returns:
- A
CompletableFuturethat will return the projects. - See Also:
-
get
This endpoint is used to fetch a list of projects by their IDs.- Parameters:
projects- - The IDs of the projects to fetch.- Returns:
- - A
CompletableFuturethat will return the projects. - See Also:
-
modify
public CompletableFuture<ModifyProject.ProjectModifications> modify(String project, ModifyProject.ProjectModifications request) This endpoint is used to modify a project by its ID.- Parameters:
project- - The ID of the project to modify.request- - The request to send.- Returns:
- A
CompletableFuturethat will return the modified project.
-
delete
This endpoint is used to delete a project by its ID.- Parameters:
project- - The ID of the project to delete.- Returns:
- A
CompletableFuturethat will return an empty response.
-
create
This endpoint will create a project based on the request.- Parameters:
request- - The request to send.- Returns:
- A
CompletableFuturethat will return the created project.
-
checkSlugAvailability
This endpoint is used to check slug availability.- Parameters:
slug- - The slug to check.- Returns:
- A
CompletableFuturethat will return true if the slug is available.
-
getProjectIdBySlug
This endpoint is used to get the project ID from a slug- Parameters:
slug- - The slug to get the ID from.- Returns:
- A
CompletableFuturethat will return the project ID.
-
createGalleryImage
public CompletableFuture<EmptyResponse> createGalleryImage(String slug, CreateGalleryImage.CreateGalleryImageRequest request) This endpoint is used to create a gallery image for a project.- Parameters:
slug- - The slug of the project to create the image for.request- - The request to send.- Returns:
- A
CompletableFuturethat will return an empty response.
-
modifyGalleryImage
public CompletableFuture<EmptyResponse> modifyGalleryImage(String slug, ModifyGalleryImage.ModifyGalleryImageRequest request) This endpoint is used to modify a gallery image for a project.- Parameters:
slug- - The slug of the project to modify the image for.request- - The request to send.- Returns:
- A
CompletableFuturethat will return an empty response.
-
deleteGalleryImage
This endpoint is used to delete a gallery image for a project.- Parameters:
slug- - The slug of the project to delete the image for.imageUrl- - The URL of the image to delete.- Returns:
- A
CompletableFuturethat will return an empty response.
-
getProjectDependencies
public CompletableFuture<GetProjectDependencies.GetProjectDependenciesResponse> getProjectDependencies(String slug) This endpoint is used to get the dependencies for a project.- Parameters:
slug- - The slug of the project to get the dependencies for.- Returns:
- A
CompletableFuturethat will return the dependencies.
-
followProject
This endpoint is used to follow a project.- Parameters:
slug- - The slug of the project to follow.- Returns:
- A
CompletableFuturethat will return an empty response.
-
unfollowProject
This endpoint is used to unfollow a project.- Parameters:
slug- - The slug of the project to unfollow.- Returns:
- A
CompletableFuturethat will return an empty response.
-
changeProjectIcon
public CompletableFuture<EmptyResponse> changeProjectIcon(String projectId, File file) throws FileNotFoundException This endpoint is used to change the icon of a project.- Parameters:
projectId- - The ID of the project to change the icon for.file- - The file to use as the icon.- Returns:
- - A
CompletableFuturethat will return an empty response. - Throws:
FileNotFoundException- - If the file is not found.- See Also:
-
changeProjectIcon
public CompletableFuture<EmptyResponse> changeProjectIcon(String projectId, InputStream stream, String fileName) This endpoint is used to change the icon of a project.- Parameters:
projectId- - The ID of the project to change the icon for.stream- - The stream to use as the icon.fileName- - The name of the file.- Returns:
- - A
CompletableFuturethat will return an empty response. - See Also:
-
deleteProjectIcon
This endpoint is used to delete a project icon.- Parameters:
projectId- - The ID of the project to delete the icon for.- Returns:
- A
CompletableFuturethat will return an empty response.
-
bulkModifyProjects
public CompletableFuture<EmptyResponse> bulkModifyProjects(BulkModifyProjects.BulkModifyProjectsRequest request) This endpoint is used to modify properties about projects in bulk.- Parameters:
request- - The request to send.- Returns:
- A
CompletableFuturethat will return an empty response.
-
getRandomProjects
This endpoint is used to get a list of random projects- Parameters:
count- - The amount of projects to get.- Returns:
- A
CompletableFuturethat will return the projects.
-
scheduleProject
public CompletableFuture<EmptyResponse> scheduleProject(String projectId, ScheduleProject.ScheduleProjectRequest request) This endpoint is used to schedule a project.- Parameters:
projectId- - The ID of the project to schedule.request- - The request to send.- Returns:
- A
CompletableFuturethat will return an empty response.
-