space_traders/models/
connected_system.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7///
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ConnectedSystem {
10    /// The symbol of the system.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    /// The sector of this system.
14    #[serde(rename = "sectorSymbol")]
15    pub sector_symbol: String,
16    #[serde(rename = "type")]
17    pub r#type: crate::models::SystemType,
18    /// The symbol of the faction that owns the connected jump gate in the system.
19    #[serde(rename = "factionSymbol", skip_serializing_if = "Option::is_none")]
20    pub faction_symbol: Option<String>,
21    /// Position in the universe in the x axis.
22    #[serde(rename = "x")]
23    pub x: i32,
24    /// Position in the universe in the y axis.
25    #[serde(rename = "y")]
26    pub y: i32,
27    /// The distance of this system to the connected Jump Gate.
28    #[serde(rename = "distance")]
29    pub distance: i32,
30}
31
32impl ConnectedSystem {
33    /// Create value with optional fields set to `None`.
34    #[allow(clippy::too_many_arguments)]
35    pub fn new(
36        symbol: String,
37        sector_symbol: String,
38        r#type: crate::models::SystemType,
39        x: i32,
40        y: i32,
41        distance: i32,
42    ) -> ConnectedSystem {
43        ConnectedSystem {
44            symbol,
45            sector_symbol,
46            r#type,
47            faction_symbol: None,
48            x,
49            y,
50            distance,
51        }
52    }
53}