Class OfficialAPI.V3

java.lang.Object
io.github.emcw.oapi.OfficialAPI.V3
Enclosing class:
OfficialAPI

public static class OfficialAPI.V3 extends Object
Simple class for interacting with the 3rd version of the API.
See Also:
  • Field Details

    • MAP_ENDPOINT

      public final String MAP_ENDPOINT
  • Constructor Details

    • V3

      @Contract(pure=true) public V3(@NotNull @NotNull KnownMap map)
  • Method Details

    • sendRequest

      @Nullable public @Nullable com.google.gson.JsonElement sendRequest(String endpoint)
      Sends a GET request to the given endpoint.

      To send a POST request, provide a RequestBodyV3 as 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

      @Nullable public @Nullable com.google.gson.JsonArray discord(DiscordReqObj[] objs)
    • location

      @Nullable public @Nullable com.google.gson.JsonArray location(Point2D[] points)
    • townsList

      @Nullable public @Nullable com.google.gson.JsonArray townsList()
    • towns

      @Nullable public @Nullable com.google.gson.JsonArray towns(String[] ids)
    • nationsList

      @Nullable public @Nullable com.google.gson.JsonArray nationsList()
    • nations

      @Nullable public @Nullable com.google.gson.JsonArray nations(String[] ids)
    • playersList

      @Nullable public @Nullable com.google.gson.JsonArray playersList()
    • players

      @Nullable public @Nullable com.google.gson.JsonArray players(String[] ids)
    • quartersList

      @Nullable public @Nullable com.google.gson.JsonArray quartersList()
    • quarters

      @Nullable public @Nullable com.google.gson.JsonArray quarters(String[] uuids)