space_traders_api/models/
ship_condition_event.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.3.0
7 * Contact: joel@spacetraders.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ShipConditionEvent : An event that represents damage or wear to a ship's reactor, frame, or engine, reducing the condition of the ship.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ShipConditionEvent {
17    #[serde(rename = "symbol")]
18    pub symbol: Symbol,
19    #[serde(rename = "component")]
20    pub component: Component,
21    /// The name of the event.
22    #[serde(rename = "name")]
23    pub name: String,
24    /// A description of the event.
25    #[serde(rename = "description")]
26    pub description: String,
27}
28
29impl ShipConditionEvent {
30    /// An event that represents damage or wear to a ship's reactor, frame, or engine, reducing the condition of the ship.
31    pub fn new(symbol: Symbol, component: Component, name: String, description: String) -> ShipConditionEvent {
32        ShipConditionEvent {
33            symbol,
34            component,
35            name,
36            description,
37        }
38    }
39}
40/// 
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Symbol {
43    #[serde(rename = "REACTOR_OVERLOAD")]
44    ReactorOverload,
45    #[serde(rename = "ENERGY_SPIKE_FROM_MINERAL")]
46    EnergySpikeFromMineral,
47    #[serde(rename = "SOLAR_FLARE_INTERFERENCE")]
48    SolarFlareInterference,
49    #[serde(rename = "COOLANT_LEAK")]
50    CoolantLeak,
51    #[serde(rename = "POWER_DISTRIBUTION_FLUCTUATION")]
52    PowerDistributionFluctuation,
53    #[serde(rename = "MAGNETIC_FIELD_DISRUPTION")]
54    MagneticFieldDisruption,
55    #[serde(rename = "HULL_MICROMETEORITE_STRIKES")]
56    HullMicrometeoriteStrikes,
57    #[serde(rename = "STRUCTURAL_STRESS_FRACTURES")]
58    StructuralStressFractures,
59    #[serde(rename = "CORROSIVE_MINERAL_CONTAMINATION")]
60    CorrosiveMineralContamination,
61    #[serde(rename = "THERMAL_EXPANSION_MISMATCH")]
62    ThermalExpansionMismatch,
63    #[serde(rename = "VIBRATION_DAMAGE_FROM_DRILLING")]
64    VibrationDamageFromDrilling,
65    #[serde(rename = "ELECTROMAGNETIC_FIELD_INTERFERENCE")]
66    ElectromagneticFieldInterference,
67    #[serde(rename = "IMPACT_WITH_EXTRACTED_DEBRIS")]
68    ImpactWithExtractedDebris,
69    #[serde(rename = "FUEL_EFFICIENCY_DEGRADATION")]
70    FuelEfficiencyDegradation,
71    #[serde(rename = "COOLANT_SYSTEM_AGEING")]
72    CoolantSystemAgeing,
73    #[serde(rename = "DUST_MICROABRASIONS")]
74    DustMicroabrasions,
75    #[serde(rename = "THRUSTER_NOZZLE_WEAR")]
76    ThrusterNozzleWear,
77    #[serde(rename = "EXHAUST_PORT_CLOGGING")]
78    ExhaustPortClogging,
79    #[serde(rename = "BEARING_LUBRICATION_FADE")]
80    BearingLubricationFade,
81    #[serde(rename = "SENSOR_CALIBRATION_DRIFT")]
82    SensorCalibrationDrift,
83    #[serde(rename = "HULL_MICROMETEORITE_DAMAGE")]
84    HullMicrometeoriteDamage,
85    #[serde(rename = "SPACE_DEBRIS_COLLISION")]
86    SpaceDebrisCollision,
87    #[serde(rename = "THERMAL_STRESS")]
88    ThermalStress,
89    #[serde(rename = "VIBRATION_OVERLOAD")]
90    VibrationOverload,
91    #[serde(rename = "PRESSURE_DIFFERENTIAL_STRESS")]
92    PressureDifferentialStress,
93    #[serde(rename = "ELECTROMAGNETIC_SURGE_EFFECTS")]
94    ElectromagneticSurgeEffects,
95    #[serde(rename = "ATMOSPHERIC_ENTRY_HEAT")]
96    AtmosphericEntryHeat,
97}
98
99impl Default for Symbol {
100    fn default() -> Symbol {
101        Self::ReactorOverload
102    }
103}
104/// 
105#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
106pub enum Component {
107    #[serde(rename = "FRAME")]
108    Frame,
109    #[serde(rename = "REACTOR")]
110    Reactor,
111    #[serde(rename = "ENGINE")]
112    Engine,
113}
114
115impl Default for Component {
116    fn default() -> Component {
117        Self::Frame
118    }
119}
120