Class OfficialAPI.V3
java.lang.Object
io.github.emcw.oapi.OfficialAPI.V3
- Enclosing class:
OfficialAPI
Simple class for interacting with the 3rd version of the API.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable com.google.gson.JsonArraydiscord(DiscordReqObj[] objs) @Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonElementsendRequest(String endpoint) Sends a GET request to the given endpoint.
To send a POST request, provide aRequestBodyV3as the second argument.com.google.gson.JsonElementsendRequest(String endpoint, @NotNull RequestBodyV3 body) Sends a POST request to the given endpoint with a valid body.@Nullable com.google.gson.JsonObject@Nullable com.google.gson.JsonArray@Nullable com.google.gson.JsonArray
-
Field Details
-
MAP_ENDPOINT
-
-
Constructor Details
-
V3
-
-
Method Details
-
sendRequest
Sends a GET request to the given endpoint.
To send a POST request, provide aRequestBodyV3as the second argument.- Parameters:
endpoint- The endpoint after the base endpoint. Ex: "/towns"- Returns:
- The received response as a base element. See
JsonElement. - See Also:
-
sendRequest
public com.google.gson.JsonElement sendRequest(String endpoint, @NotNull @NotNull RequestBodyV3 body) Sends a POST request to the given endpoint with a valid body.- Parameters:
endpoint- The endpoint after the base endpoint. Ex: "/towns"body- The body to send along with the request - the schema must match what is required for the endpoint.- Returns:
- The received response as a base element. See
JsonElement.
-
serverInfo
@Nullable public @Nullable com.google.gson.JsonObject serverInfo() -
discord
-
location
-
townsList
@Nullable public @Nullable com.google.gson.JsonArray townsList() -
towns
-
nationsList
@Nullable public @Nullable com.google.gson.JsonArray nationsList() -
nations
-
playersList
@Nullable public @Nullable com.google.gson.JsonArray playersList() -
players
-
quartersList
@Nullable public @Nullable com.google.gson.JsonArray quartersList() -
quarters
-