hypixel/endpoints/
resources.rs1use serde_json::Value;
2
3use crate::client::HypixelClient;
4use crate::error::Result;
5use crate::models::resources::*;
6
7impl HypixelClient {
8 pub async fn resource_games(&self) -> Result<std::collections::HashMap<String, Game>> {
10 let resp: GamesResponse = self.request("/v2/resources/games", &[], false).await?;
11 Ok(resp.games)
12 }
13
14 pub async fn resource_achievements(&self) -> Result<Value> {
16 self.request("/v2/resources/achievements", &[], false).await
17 }
18
19 pub async fn resource_challenges(&self) -> Result<Value> {
21 self.request("/v2/resources/challenges", &[], false).await
22 }
23
24 pub async fn resource_quests(&self) -> Result<Value> {
26 self.request("/v2/resources/quests", &[], false).await
27 }
28
29 pub async fn resource_guild_achievements(&self) -> Result<Value> {
31 self.request("/v2/resources/guilds/achievements", &[], false)
32 .await
33 }
34
35 pub async fn resource_vanity_pets(&self) -> Result<Value> {
37 self.request("/v2/resources/vanity/pets", &[], false).await
38 }
39
40 pub async fn resource_vanity_companions(&self) -> Result<Value> {
42 self.request("/v2/resources/vanity/companions", &[], false)
43 .await
44 }
45
46 pub async fn resource_skyblock_collections(&self) -> Result<CollectionsResource> {
48 self.request("/v2/resources/skyblock/collections", &[], false)
49 .await
50 }
51
52 pub async fn resource_skyblock_skills(&self) -> Result<SkillsResource> {
54 self.request("/v2/resources/skyblock/skills", &[], false)
55 .await
56 }
57
58 pub async fn resource_skyblock_items(&self) -> Result<Vec<SkyBlockItem>> {
60 let resp: ItemsResponse = self
61 .request("/v2/resources/skyblock/items", &[], false)
62 .await?;
63 Ok(resp.items)
64 }
65
66 pub async fn resource_skyblock_election(&self) -> Result<ElectionResource> {
68 self.request("/v2/resources/skyblock/election", &[], false)
69 .await
70 }
71
72 pub async fn resource_packs(&self) -> Result<Vec<ResourcePack>> {
74 let resp: PacksResponse = self.request("/v2/resources/packs", &[], false).await?;
75 Ok(resp.packs)
76 }
77
78 pub async fn resource_skyblock_bingo(&self) -> Result<Value> {
80 self.request("/v2/resources/skyblock/bingo", &[], false)
81 .await
82 }
83}