space_traders/models/
scanned_ship.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The ship that was scanned. Details include information about the ship that could be detected by the scanner.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ScannedShip {
10    /// The globally unique identifier of the ship.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    #[serde(rename = "registration")]
14    pub registration: crate::models::ShipRegistration,
15    #[serde(rename = "nav")]
16    pub nav: crate::models::ShipNav,
17    #[serde(rename = "frame", skip_serializing_if = "Option::is_none")]
18    pub frame: Option<crate::models::ScannedShipFrame>,
19    #[serde(rename = "reactor", skip_serializing_if = "Option::is_none")]
20    pub reactor: Option<crate::models::ScannedShipReactor>,
21    #[serde(rename = "engine")]
22    pub engine: crate::models::ScannedShipEngine,
23    /// List of mounts installed in the ship.
24    #[serde(rename = "mounts", skip_serializing_if = "Option::is_none")]
25    pub mounts: Option<Vec<crate::models::ScannedShipMountsInner>>,
26}
27
28impl ScannedShip {
29    /// Create value with optional fields set to `None`.
30    #[allow(clippy::too_many_arguments)]
31    pub fn new(
32        symbol: String,
33        registration: crate::models::ShipRegistration,
34        nav: crate::models::ShipNav,
35        engine: crate::models::ScannedShipEngine,
36    ) -> ScannedShip {
37        ScannedShip {
38            symbol,
39            registration,
40            nav,
41            frame: None,
42            reactor: None,
43            engine,
44            mounts: None,
45        }
46    }
47}