space-traders 0.1.1

Async SpaceTraders API client for Rust.
Documentation
//! Generated by: <https://openapi-generator.tech>
//!
//! Version of specification: `2.0.0`

use serde::{Deserialize, Serialize};

/// The type of waypoint.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WaypointType {
    #[serde(rename = "PLANET")]
    Planet,
    #[serde(rename = "GAS_GIANT")]
    GasGiant,
    #[serde(rename = "MOON")]
    Moon,
    #[serde(rename = "ORBITAL_STATION")]
    OrbitalStation,
    #[serde(rename = "JUMP_GATE")]
    JumpGate,
    #[serde(rename = "ASTEROID_FIELD")]
    AsteroidField,
    #[serde(rename = "NEBULA")]
    Nebula,
    #[serde(rename = "DEBRIS_FIELD")]
    DebrisField,
    #[serde(rename = "GRAVITY_WELL")]
    GravityWell,
}

impl ToString for WaypointType {
    fn to_string(&self) -> String {
        match self {
            Self::Planet => String::from("PLANET"),
            Self::GasGiant => String::from("GAS_GIANT"),
            Self::Moon => String::from("MOON"),
            Self::OrbitalStation => String::from("ORBITAL_STATION"),
            Self::JumpGate => String::from("JUMP_GATE"),
            Self::AsteroidField => String::from("ASTEROID_FIELD"),
            Self::Nebula => String::from("NEBULA"),
            Self::DebrisField => String::from("DEBRIS_FIELD"),
            Self::GravityWell => String::from("GRAVITY_WELL"),
        }
    }
}