brawl-rs 0.1.0

A Rust wrapper for the Brawl Stars API
Documentation
//! API endpoint definitions and constants.
//!
//! This module contains the base URL and enum of all available Brawl Stars API endpoints.

use crate::data::brawlers::BrawlerId;

/// Base URL for all Brawl Stars API requests
pub(crate) const BASE_URL: &str = "https://api.brawlstars.com/v1/";

/// API endpoints available in the Brawl Stars API.
///
/// This enum represents all the different endpoints that can be accessed through
/// the Brawl Stars API
///
#[derive(strum_macros::Display)]
pub enum Endpoint {
    #[strum(serialize = "players/%23{0}")]
    Player(String),
    #[strum(serialize = "players/%23{0}/battlelog")]
    BattleLog(String),
    #[strum(serialize = "clubs/%23{0}")]
    Club(String),
    #[strum(serialize = "brawlers")]
    Brawlers,
    #[strum(serialize = "brawlers/{0}")]
    Brawler(BrawlerId),
    #[strum(serialize = "gamemodes")]
    GameModes,
    #[strum(serialize = "events/rotation")]
    Rotation,
    #[strum(serialize = "rankings/{0}/clubs")]
    RankingsClubs(String),
    #[strum(serialize = "rankings/{0}/players")]
    RankingsPlayers(String),
}