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};

/// A waypoint is a location that ships can travel to such as a Planet, Moon or Space Station.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Waypoint {
    /// Symbol fo the waypoint.
    #[serde(rename = "symbol")]
    pub symbol: String,
    #[serde(rename = "type")]
    pub r#type: crate::models::WaypointType,
    /// The symbol of the system this waypoint belongs to.
    #[serde(rename = "systemSymbol")]
    pub system_symbol: 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,
    /// Waypoints that orbit this waypoint.
    #[serde(rename = "orbitals")]
    pub orbitals: Vec<crate::models::WaypointOrbital>,
    #[serde(rename = "faction", skip_serializing_if = "Option::is_none")]
    pub faction: Option<crate::models::WaypointFaction>,
    /// The traits of the waypoint.
    #[serde(rename = "traits")]
    pub traits: Vec<crate::models::WaypointTrait>,
    #[serde(rename = "chart", skip_serializing_if = "Option::is_none")]
    pub chart: Option<crate::models::Chart>,
}

impl Waypoint {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: String,
        r#type: crate::models::WaypointType,
        system_symbol: String,
        x: i32,
        y: i32,
        orbitals: Vec<crate::models::WaypointOrbital>,
        traits: Vec<crate::models::WaypointTrait>,
    ) -> Waypoint {
        Waypoint {
            symbol,
            r#type,
            system_symbol,
            x,
            y,
            orbitals,
            faction: None,
            traits,
            chart: None,
        }
    }
}