space_traders/models/
ship_cargo_item.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The type of cargo item and the number of units.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipCargoItem {
10    /// The unique identifier of the cargo item type.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    /// The name of the cargo item type.
14    #[serde(rename = "name")]
15    pub name: String,
16    /// The description of the cargo item type.
17    #[serde(rename = "description")]
18    pub description: String,
19    /// The number of units of the cargo item.
20    #[serde(rename = "units")]
21    pub units: u32,
22}
23
24impl ShipCargoItem {
25    /// Create value with optional fields set to `None`.
26    #[allow(clippy::too_many_arguments)]
27    pub fn new(symbol: String, name: String, description: String, units: u32) -> ShipCargoItem {
28        ShipCargoItem {
29            symbol,
30            name,
31            description,
32            units,
33        }
34    }
35}