Skip to content

Commit 5ed57ca

Browse files
Add support for the bingo data endpoint (#520)
1 parent 1862d9e commit 5ed57ca

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.hypixel.api.http.HypixelHttpResponse;
1010
import net.hypixel.api.reply.*;
1111
import net.hypixel.api.reply.skyblock.*;
12+
import net.hypixel.api.reply.skyblock.bingo.SkyBlockBingoDataReply;
1213
import net.hypixel.api.util.PropertyFilter;
1314
import net.hypixel.api.util.ResourceType;
1415
import net.hypixel.api.util.Utilities;
@@ -250,6 +251,32 @@ public CompletableFuture<SkyBlockProfilesReply> getSkyBlockProfiles(String playe
250251
);
251252
}
252253

254+
/**
255+
* Request the bingo data of a provided player. See <a href="https://api.hypixel.net/#tag/SkyBlock/paths/~1skyblock~1bingo/get">/skyblock/bingo</a>
256+
*
257+
* @param player uuid of a player.
258+
* @return CompletableFuture containing a {@link SkyBlockBingoDataReply}
259+
*/
260+
public CompletableFuture<SkyBlockBingoDataReply> getSkyblockBingoData(UUID player) {
261+
return get(SkyBlockBingoDataReply.class, "skyblock/bingo",
262+
HTTPQueryParams.create()
263+
.add("uuid", player)
264+
);
265+
}
266+
267+
/**
268+
* Request the bingo data of a provided player. See <a href="https://api.hypixel.net/#tag/SkyBlock/paths/~1skyblock~1bingo/get">/skyblock/bingo</a>
269+
*
270+
* @param player uuid of a player in string format, can be both dashed or undashed.
271+
* @return CompletableFuture containing a {@link SkyBlockBingoDataReply}
272+
*/
273+
public CompletableFuture<SkyBlockBingoDataReply> getSkyblockBingoData(String player) {
274+
return get(SkyBlockBingoDataReply.class, "skyblock/bingo",
275+
HTTPQueryParams.create()
276+
.add("uuid", player)
277+
);
278+
}
279+
253280
public CompletableFuture<SkyBlockNewsReply> getSkyBlockNews() {
254281
return get(SkyBlockNewsReply.class, "skyblock/news");
255282
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package net.hypixel.api.reply.skyblock.bingo;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
5+
import java.util.List;
6+
7+
public class BingoEventData {
8+
private int key;
9+
private int points;
10+
@SerializedName("completed_goals")
11+
private List<String> completedGoals;
12+
13+
public int getKey() {
14+
return key;
15+
}
16+
17+
public int getPoints() {
18+
return points;
19+
}
20+
21+
public List<String> getCompletedGoals() {
22+
return completedGoals;
23+
}
24+
25+
@Override
26+
public String toString() {
27+
return "BingoEventData{" +
28+
"key=" + key +
29+
", points=" + points +
30+
", completedGoals=" + completedGoals +
31+
'}';
32+
}
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package net.hypixel.api.reply.skyblock.bingo;
2+
3+
import net.hypixel.api.reply.AbstractReply;
4+
5+
import java.util.List;
6+
7+
public class SkyBlockBingoDataReply extends AbstractReply {
8+
private List<BingoEventData> events;
9+
10+
public List<BingoEventData> getEvents() {
11+
return events;
12+
}
13+
14+
@Override
15+
public String toString() {
16+
return "SkyBlockBingoPlayerDataReply{" +
17+
"events=" + events +
18+
"} " + super.toString();
19+
}
20+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package net.hypixel.api.example.skyblock;
2+
3+
import net.hypixel.api.example.ExampleUtil;
4+
5+
public class GetSkyBlockBingoDataExample {
6+
public static void main(String[] args) {
7+
ExampleUtil.API.getSkyblockBingoData(ExampleUtil.HYPIXEL).whenComplete(ExampleUtil.getTestConsumer());
8+
ExampleUtil.await();
9+
}
10+
}

0 commit comments

Comments
 (0)