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};

/// Ship details.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Ship {
    /// The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]-[HEX_ID]`
    #[serde(rename = "symbol")]
    pub symbol: String,
    #[serde(rename = "registration")]
    pub registration: crate::models::ShipRegistration,
    #[serde(rename = "nav")]
    pub nav: crate::models::ShipNav,
    #[serde(rename = "crew")]
    pub crew: crate::models::ShipCrew,
    #[serde(rename = "frame")]
    pub frame: crate::models::ShipFrame,
    #[serde(rename = "reactor")]
    pub reactor: crate::models::ShipReactor,
    #[serde(rename = "engine")]
    pub engine: crate::models::ShipEngine,
    /// Modules installed in this ship.
    #[serde(rename = "modules")]
    pub modules: Vec<crate::models::ShipModule>,
    /// Mounts installed in this ship.
    #[serde(rename = "mounts")]
    pub mounts: Vec<crate::models::ShipMount>,
    #[serde(rename = "cargo")]
    pub cargo: crate::models::ShipCargo,
    #[serde(rename = "fuel")]
    pub fuel: crate::models::ShipFuel,
}

impl Ship {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: String,
        registration: crate::models::ShipRegistration,
        nav: crate::models::ShipNav,
        crew: crate::models::ShipCrew,
        frame: crate::models::ShipFrame,
        reactor: crate::models::ShipReactor,
        engine: crate::models::ShipEngine,
        modules: Vec<crate::models::ShipModule>,
        mounts: Vec<crate::models::ShipMount>,
        cargo: crate::models::ShipCargo,
        fuel: crate::models::ShipFuel,
    ) -> Ship {
        Ship {
            symbol,
            registration,
            nav,
            crew,
            frame,
            reactor,
            engine,
            modules,
            mounts,
            cargo,
            fuel,
        }
    }
}