space-traders-api 0.1.2

Generated API client for SpaceTraders
Documentation
/*
 * SpaceTraders API
 *
 * 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.   
 *
 * The version of the OpenAPI document: 2.3.0
 * Contact: joel@spacetraders.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ShipModule : A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew. Module installations are permanent.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipModule {
    /// The symbol of the module.
    #[serde(rename = "symbol")]
    pub symbol: Symbol,
    /// Modules that provide capacity, such as cargo hold or crew quarters will show this value to denote how much of a bonus the module grants.
    #[serde(rename = "capacity", skip_serializing_if = "Option::is_none")]
    pub capacity: Option<i32>,
    /// Modules that have a range will such as a sensor array show this value to denote how far can the module reach with its capabilities.
    #[serde(rename = "range", skip_serializing_if = "Option::is_none")]
    pub range: Option<i32>,
    /// Name of this module.
    #[serde(rename = "name")]
    pub name: String,
    /// Description of this module.
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "requirements")]
    pub requirements: Box<models::ShipRequirements>,
}

impl ShipModule {
    /// A module can be installed in a ship and provides a set of capabilities such as storage space or quarters for crew. Module installations are permanent.
    pub fn new(symbol: Symbol, name: String, description: String, requirements: models::ShipRequirements) -> ShipModule {
        ShipModule {
            symbol,
            capacity: None,
            range: None,
            name,
            description,
            requirements: Box::new(requirements),
        }
    }
}
/// The symbol of the module.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Symbol {
    #[serde(rename = "MODULE_MINERAL_PROCESSOR_I")]
    ModuleMineralProcessorI,
    #[serde(rename = "MODULE_GAS_PROCESSOR_I")]
    ModuleGasProcessorI,
    #[serde(rename = "MODULE_CARGO_HOLD_I")]
    ModuleCargoHoldI,
    #[serde(rename = "MODULE_CARGO_HOLD_II")]
    ModuleCargoHoldIi,
    #[serde(rename = "MODULE_CARGO_HOLD_III")]
    ModuleCargoHoldIii,
    #[serde(rename = "MODULE_CREW_QUARTERS_I")]
    ModuleCrewQuartersI,
    #[serde(rename = "MODULE_ENVOY_QUARTERS_I")]
    ModuleEnvoyQuartersI,
    #[serde(rename = "MODULE_PASSENGER_CABIN_I")]
    ModulePassengerCabinI,
    #[serde(rename = "MODULE_MICRO_REFINERY_I")]
    ModuleMicroRefineryI,
    #[serde(rename = "MODULE_ORE_REFINERY_I")]
    ModuleOreRefineryI,
    #[serde(rename = "MODULE_FUEL_REFINERY_I")]
    ModuleFuelRefineryI,
    #[serde(rename = "MODULE_SCIENCE_LAB_I")]
    ModuleScienceLabI,
    #[serde(rename = "MODULE_JUMP_DRIVE_I")]
    ModuleJumpDriveI,
    #[serde(rename = "MODULE_JUMP_DRIVE_II")]
    ModuleJumpDriveIi,
    #[serde(rename = "MODULE_JUMP_DRIVE_III")]
    ModuleJumpDriveIii,
    #[serde(rename = "MODULE_WARP_DRIVE_I")]
    ModuleWarpDriveI,
    #[serde(rename = "MODULE_WARP_DRIVE_II")]
    ModuleWarpDriveIi,
    #[serde(rename = "MODULE_WARP_DRIVE_III")]
    ModuleWarpDriveIii,
    #[serde(rename = "MODULE_SHIELD_GENERATOR_I")]
    ModuleShieldGeneratorI,
    #[serde(rename = "MODULE_SHIELD_GENERATOR_II")]
    ModuleShieldGeneratorIi,
}

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