ocpi 0.3.5

Unofficial, in progress, OCPI implementation
Documentation
#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum AuthMethod {
    /// Authentication request has been sent to the eMSP.
    AuthRequest,

    /// Command like StartSession or ReserveNow used to start the Session,
    /// the Token provided in the Command was used as authorization.
    Command,

    /// Whitelist used for authentication, no request to the eMSP has been performed.
    Whitelist,
}

#[cfg(test)]
mod tests {

    use super::*;

    #[test]
    fn serialize_token_type() {
        assert_eq!(
            serde_json::to_string(&AuthMethod::AuthRequest).expect("Serializing"),
            r#""AUTH_REQUEST""#,
        );
        assert_eq!(
            serde_json::to_string(&AuthMethod::Command).expect("Serializing"),
            r#""COMMAND""#,
        );
        assert_eq!(
            serde_json::to_string(&AuthMethod::Whitelist).expect("Serializing"),
            r#""WHITELIST""#,
        );
    }
}