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 SystemType {
    #[serde(rename = "NEUTRON_STAR")]
    NeutronStar,
    #[serde(rename = "RED_STAR")]
    RedStar,
    #[serde(rename = "ORANGE_STAR")]
    OrangeStar,
    #[serde(rename = "BLUE_STAR")]
    BlueStar,
    #[serde(rename = "YOUNG_STAR")]
    YoungStar,
    #[serde(rename = "WHITE_DWARF")]
    WhiteDwarf,
    #[serde(rename = "BLACK_HOLE")]
    BlackHole,
    #[serde(rename = "HYPERGIANT")]
    Hypergiant,
    #[serde(rename = "NEBULA")]
    Nebula,
    #[serde(rename = "UNSTABLE")]
    Unstable,
}

impl ToString for SystemType {
    fn to_string(&self) -> String {
        match self {
            Self::NeutronStar => String::from("NEUTRON_STAR"),
            Self::RedStar => String::from("RED_STAR"),
            Self::OrangeStar => String::from("ORANGE_STAR"),
            Self::BlueStar => String::from("BLUE_STAR"),
            Self::YoungStar => String::from("YOUNG_STAR"),
            Self::WhiteDwarf => String::from("WHITE_DWARF"),
            Self::BlackHole => String::from("BLACK_HOLE"),
            Self::Hypergiant => String::from("HYPERGIANT"),
            Self::Nebula => String::from("NEBULA"),
            Self::Unstable => String::from("UNSTABLE"),
        }
    }
}