#[cfg(feature = "blocking")]
use crate::helpers::make_request_blocking;
use crate::{Result, helpers::make_request, leaderboard::requests::GetLeaderboardInfoParams};

use super::EloLeaderboardInfo;

impl EloLeaderboardInfo {
	/// GET the user leaderboard using given `params`
	pub async fn get<'a>(params: impl Into<Option<&'a GetLeaderboardInfoParams>>) -> Result<Self> {
		make_request!("https://api.mcsrranked.com/leaderboard" [] params.into())
	}
}

#[cfg(feature = "blocking")]
impl EloLeaderboardInfo {
	/// Synchronously GET the user leaderboard using given `params`
	pub fn get_blocking<'a>(
		params: impl Into<Option<&'a GetLeaderboardInfoParams>>,
	) -> Result<Self> {
		make_request_blocking!("https://api.mcsrranked.com/leaderboard" [] params.into())
	}
}
