analyticord 0.1.2

Simple wrapper around the Analyticord API.
Documentation
macro_rules! define_error_enum {
    ($name:ident { $(#[doc=$doc:expr] $variant:ident),* }) => {
        #[derive(Serialize, Deserialize, Debug, Error)]
        #[serde(tag = "error")]
        #[serde(rename_all = "camelCase")]
        /// Represents all the errors.
        pub enum $name {
            $(#[error(msg_embedded, non_std, no_from)]
              #[doc=$doc]
                $variant {
                    /// Exactly why you messed up. every single detail.
                    description: String}),*,
            /// No idea what you messed up this time
            Unknown
        }
    }
}

define_error_enum!(AnalyticordError {
    /// Something doesn't match (Maybe you sent a string instead of a number or something)
    DataValidationError,
    /// An option that was provided returned invalid results
    InvalidOption,
    /// YOU JUST GOT RATELIMITED BOI
    Ratelimit,
    /// Not all of the required details were submitted with your request
    NotEnoughDetail,
    /// You didn't provide a query with your GET request
    NoQuery,
    /// No auth header was sent.
    NoAuth,
    /// Viewing the logs is disabled.
    LogsDisabled,
    /// This is an error because the error you requested doesn't exist. oh... my... god.
    NotAnError,
    /// You just got BAMBOOZLED
    LolMemes,
    /// This feature isn's currently supported
    FeatureDisabled,
    /// Something went wrong and we couldn't create your bot
    BotCreationFailed,
    /// just an error.
    Nightmare,
    /// The import of your data failed
    DataInputFailed,
    /// You didn't send us any headers with your request?!?!?!?!
    NoHeaders,
    /// Something has gone wrong (Nevs UK server probably died). Devs have been alerted.
    UnknownError,
    /// You have provided an invalid type of authentication for this endpoint.
    WrongAuthHeaders,
    /// You've connected with the wrong domain name or IP address
    WrongDomain,
    /// That event type doesn't exist.
    NoEventType,
    /// The user might not exist or something has gone HORRIBLY WRONG.
    MiscUserError,
    /// There's no data for this bot & eventType
    NoData,
    /// Invalid token
    AuthFailed,
    /// The length of data provided didn't match what we were expecting.
    LengthMismatch,
    /// That token doesn't exist.
    WrongToken,
    /// Your account isn't verified
    UserNotVerified,
    /// That bot doesn't exist
    BotNonExistant
});

/// Convenience Result which has AnalyticordError hardcoded as Error type
pub type Result<T> = ::std::result::Result<T, AnalyticordError>;