space_traders/models/
ship_cargo.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Ship cargo details.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipCargo {
10    /// The max number of items that can be stored in the cargo hold.
11    #[serde(rename = "capacity")]
12    pub capacity: u32,
13    /// The number of items currently stored in the cargo hold.
14    #[serde(rename = "units")]
15    pub units: u32,
16    /// The items currently in the cargo hold.
17    #[serde(rename = "inventory")]
18    pub inventory: Vec<crate::models::ShipCargoItem>,
19}
20
21impl ShipCargo {
22    /// Create value with optional fields set to `None`.
23    #[allow(clippy::too_many_arguments)]
24    pub fn new(
25        capacity: u32,
26        units: u32,
27        inventory: Vec<crate::models::ShipCargoItem>,
28    ) -> ShipCargo {
29        ShipCargo {
30            capacity,
31            units,
32            inventory,
33        }
34    }
35}