pies_openapi_spacetraders_api/models/
ship_role.rs

1/*
2 * SpaceTraders API
3 *
4 * SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe.  The API is documented using [OpenAPI](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server.  ```json http {   \"method\": \"GET\",   \"url\": \"https://api.spacetraders.io/v2\", } ```  Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community.  We have a [Discord channel](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.   
5 *
6 * The version of the OpenAPI document: 2.0.0
7 * Contact: joel@spacetraders.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// ShipRole : The registered role of the ship
12
13/// The registered role of the ship
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
15pub enum ShipRole {
16    #[serde(rename = "FABRICATOR")]
17    Fabricator,
18    #[serde(rename = "HARVESTER")]
19    Harvester,
20    #[serde(rename = "HAULER")]
21    Hauler,
22    #[serde(rename = "INTERCEPTOR")]
23    Interceptor,
24    #[serde(rename = "EXCAVATOR")]
25    Excavator,
26    #[serde(rename = "TRANSPORT")]
27    Transport,
28    #[serde(rename = "REPAIR")]
29    Repair,
30    #[serde(rename = "SURVEYOR")]
31    Surveyor,
32    #[serde(rename = "COMMAND")]
33    Command,
34    #[serde(rename = "CARRIER")]
35    Carrier,
36    #[serde(rename = "PATROL")]
37    Patrol,
38    #[serde(rename = "SATELLITE")]
39    Satellite,
40    #[serde(rename = "EXPLORER")]
41    Explorer,
42    #[serde(rename = "REFINERY")]
43    Refinery,
44
45}
46
47impl ToString for ShipRole {
48    fn to_string(&self) -> String {
49        match self {
50            Self::Fabricator => String::from("FABRICATOR"),
51            Self::Harvester => String::from("HARVESTER"),
52            Self::Hauler => String::from("HAULER"),
53            Self::Interceptor => String::from("INTERCEPTOR"),
54            Self::Excavator => String::from("EXCAVATOR"),
55            Self::Transport => String::from("TRANSPORT"),
56            Self::Repair => String::from("REPAIR"),
57            Self::Surveyor => String::from("SURVEYOR"),
58            Self::Command => String::from("COMMAND"),
59            Self::Carrier => String::from("CARRIER"),
60            Self::Patrol => String::from("PATROL"),
61            Self::Satellite => String::from("SATELLITE"),
62            Self::Explorer => String::from("EXPLORER"),
63            Self::Refinery => String::from("REFINERY"),
64        }
65    }
66}
67
68impl Default for ShipRole {
69    fn default() -> ShipRole {
70        Self::Fabricator
71    }
72}
73
74
75
76