Class RequestManager
java.lang.Object
dk.minepay.server.bukkit.managers.RequestManager
Manager class for handling store requests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectacceptRequest(String requestId) Accepts a store request with the given request ID.com.google.gson.JsonObjectacceptVote(String voteId) Accepts a vote with the given vote ID.com.google.gson.JsonObjectcancelRequest(String requestId) Cancels a store request with the given request ID.com.google.gson.JsonObjectcreateRequest(UUID uuid, StoreProduct[] storeProducts) Creates a new store request for the given player UUID and store products.getRequest(String requestId) Retrieves a store request with the given request ID.getRequests(RequestBody body) Retrieves store requests with the given request statuses.Retrieves a vote with the given vote ID.Vote[]Retrieves votes with the given vote statuses.
-
Constructor Details
-
RequestManager
public RequestManager()Constructor for the RequestManager class.
-
-
Method Details
-
createRequest
Creates a new store request for the given player UUID and store products.- Parameters:
uuid- the UUID of the playerstoreProducts- the store products to include in the request- Returns:
- a JsonObject representing the response from the store API
-
getRequests
Retrieves store requests with the given request statuses.- Parameters:
body- the request body containing the request statuses- Returns:
- an array of StoreRequest objects representing the retrieved requests
-
getRequest
Retrieves a store request with the given request ID.- Parameters:
requestId- the ID of the request to retrieve- Returns:
- a StoreRequest object representing the retrieved request
-
acceptRequest
Accepts a store request with the given request ID.- Parameters:
requestId- the ID of the request to accept- Returns:
- a JsonObject representing the response from the store API
-
cancelRequest
Cancels a store request with the given request ID.- Parameters:
requestId- the ID of the request to cancel- Returns:
- a JsonObject representing the response from the store API
-
getVotes
Retrieves votes with the given vote statuses.- Parameters:
body- the vote body containing the vote statuses- Returns:
- an array of Vote objects representing the retrieved votes
-
getVote
Retrieves a vote with the given vote ID.- Parameters:
voteId- the ID of the vote to retrieve- Returns:
- a Vote object representing the retrieved vote
-
acceptVote
Accepts a vote with the given vote ID.- Parameters:
voteId- the ID of the vote to accept- Returns:
- a JsonObject representing the response from the vote API
-