space_traders/models/
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 System {
10    /// The symbol of the system.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    /// The symbol of the sector.
14    #[serde(rename = "sectorSymbol")]
15    pub sector_symbol: String,
16    #[serde(rename = "type")]
17    pub r#type: crate::models::SystemType,
18    /// Position in the universe in the x axis.
19    #[serde(rename = "x")]
20    pub x: i32,
21    /// Position in the universe in the y axis.
22    #[serde(rename = "y")]
23    pub y: i32,
24    /// Waypoints in this system.
25    #[serde(rename = "waypoints")]
26    pub waypoints: Vec<crate::models::SystemWaypoint>,
27    /// Factions that control this system.
28    #[serde(rename = "factions")]
29    pub factions: Vec<crate::models::SystemFaction>,
30}
31
32impl System {
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        waypoints: Vec<crate::models::SystemWaypoint>,
42        factions: Vec<crate::models::SystemFaction>,
43    ) -> System {
44        System {
45            symbol,
46            sector_symbol,
47            r#type,
48            x,
49            y,
50            waypoints,
51            factions,
52        }
53    }
54}