space-traders 0.1.1

Async SpaceTraders API client for Rust.
Documentation
//! Generated by: <https://openapi-generator.tech>
//!
//! Version of specification: `2.0.0`

use serde::{Deserialize, Serialize};

///
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ConnectedSystem {
    /// The symbol of the system.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The sector of this system.
    #[serde(rename = "sectorSymbol")]
    pub sector_symbol: String,
    #[serde(rename = "type")]
    pub r#type: crate::models::SystemType,
    /// The symbol of the faction that owns the connected jump gate in the system.
    #[serde(rename = "factionSymbol", skip_serializing_if = "Option::is_none")]
    pub faction_symbol: Option<String>,
    /// Position in the universe in the x axis.
    #[serde(rename = "x")]
    pub x: i32,
    /// Position in the universe in the y axis.
    #[serde(rename = "y")]
    pub y: i32,
    /// The distance of this system to the connected Jump Gate.
    #[serde(rename = "distance")]
    pub distance: i32,
}

impl ConnectedSystem {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: String,
        sector_symbol: String,
        r#type: crate::models::SystemType,
        x: i32,
        y: i32,
        distance: i32,
    ) -> ConnectedSystem {
        ConnectedSystem {
            symbol,
            sector_symbol,
            r#type,
            faction_symbol: None,
            x,
            y,
            distance,
        }
    }
}