use serde_json::Value;
use crate::client::HypixelClient;
use crate::error::Result;
use crate::models::resources::*;
impl HypixelClient {
pub async fn resource_games(&self) -> Result<std::collections::HashMap<String, Game>> {
let resp: GamesResponse = self.request("/v2/resources/games", &[], false).await?;
Ok(resp.games)
}
pub async fn resource_achievements(&self) -> Result<Value> {
self.request("/v2/resources/achievements", &[], false).await
}
pub async fn resource_challenges(&self) -> Result<Value> {
self.request("/v2/resources/challenges", &[], false).await
}
pub async fn resource_quests(&self) -> Result<Value> {
self.request("/v2/resources/quests", &[], false).await
}
pub async fn resource_guild_achievements(&self) -> Result<Value> {
self.request("/v2/resources/guilds/achievements", &[], false)
.await
}
pub async fn resource_vanity_pets(&self) -> Result<Value> {
self.request("/v2/resources/vanity/pets", &[], false).await
}
pub async fn resource_vanity_companions(&self) -> Result<Value> {
self.request("/v2/resources/vanity/companions", &[], false)
.await
}
pub async fn resource_skyblock_collections(&self) -> Result<CollectionsResource> {
self.request("/v2/resources/skyblock/collections", &[], false)
.await
}
pub async fn resource_skyblock_skills(&self) -> Result<SkillsResource> {
self.request("/v2/resources/skyblock/skills", &[], false)
.await
}
pub async fn resource_skyblock_items(&self) -> Result<Vec<SkyBlockItem>> {
let resp: ItemsResponse = self
.request("/v2/resources/skyblock/items", &[], false)
.await?;
Ok(resp.items)
}
pub async fn resource_skyblock_election(&self) -> Result<ElectionResource> {
self.request("/v2/resources/skyblock/election", &[], false)
.await
}
pub async fn resource_packs(&self) -> Result<Vec<ResourcePack>> {
let resp: PacksResponse = self.request("/v2/resources/packs", &[], false).await?;
Ok(resp.packs)
}
pub async fn resource_skyblock_bingo(&self) -> Result<Value> {
self.request("/v2/resources/skyblock/bingo", &[], false)
.await
}
}