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

/// Results of a transaction with a shipyard.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipyardTransaction {
    /// The symbol of the waypoint where the transaction took place.
    #[serde(rename = "waypointSymbol")]
    pub waypoint_symbol: String,
    /// The symbol of the ship that was the subject of the transaction.
    #[serde(rename = "shipSymbol")]
    pub ship_symbol: String,
    /// The price of the transaction.
    #[serde(rename = "price")]
    pub price: u32,
    /// The symbol of the agent that made the transaction.
    #[serde(rename = "agentSymbol")]
    pub agent_symbol: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
}

impl ShipyardTransaction {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        waypoint_symbol: String,
        ship_symbol: String,
        price: u32,
        agent_symbol: String,
        timestamp: String,
    ) -> ShipyardTransaction {
        ShipyardTransaction {
            waypoint_symbol,
            ship_symbol,
            price,
            agent_symbol,
            timestamp,
        }
    }
}