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 type of cargo item and the number of units.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipCargoItem {
    /// The unique identifier of the cargo item type.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The name of the cargo item type.
    #[serde(rename = "name")]
    pub name: String,
    /// The description of the cargo item type.
    #[serde(rename = "description")]
    pub description: String,
    /// The number of units of the cargo item.
    #[serde(rename = "units")]
    pub units: u32,
}

impl ShipCargoItem {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(symbol: String, name: String, description: String, units: u32) -> ShipCargoItem {
        ShipCargoItem {
            symbol,
            name,
            description,
            units,
        }
    }
}