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 reactor of the ship. The reactor is responsible for powering the ship's systems and weapons.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipReactor {
    /// Symbol of the reactor.
    #[serde(rename = "symbol")]
    pub symbol: Symbol,
    /// Name of the reactor.
    #[serde(rename = "name")]
    pub name: String,
    /// Description of the reactor.
    #[serde(rename = "description")]
    pub description: String,
    /// Condition is a range of 0 to 100 where 0 is completely worn out and 100 is brand new.
    #[serde(rename = "condition", skip_serializing_if = "Option::is_none")]
    pub condition: Option<u32>,
    /// The amount of power provided by this reactor. The more power a reactor provides to the ship, the lower the cooldown it gets when using a module or mount that taxes the ship's power.
    #[serde(rename = "powerOutput")]
    pub power_output: u32,
    #[serde(rename = "requirements")]
    pub requirements: crate::models::ShipRequirements,
}

impl ShipReactor {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: Symbol,
        name: String,
        description: String,
        power_output: u32,
        requirements: crate::models::ShipRequirements,
    ) -> ShipReactor {
        ShipReactor {
            symbol,
            name,
            description,
            condition: None,
            power_output,
            requirements,
        }
    }
}

/// Symbol of the reactor.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Symbol {
    #[serde(rename = "REACTOR_SOLAR_I")]
    SolarI,
    #[serde(rename = "REACTOR_FUSION_I")]
    FusionI,
    #[serde(rename = "REACTOR_FISSION_I")]
    FissionI,
    #[serde(rename = "REACTOR_CHEMICAL_I")]
    ChemicalI,
    #[serde(rename = "REACTOR_ANTIMATTER_I")]
    AntimatterI,
}

impl Default for Symbol {
    fn default() -> Symbol {
        Self::SolarI
    }
}