space_traders/models/
shipyard_transaction.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Results of a transaction with a shipyard.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ShipyardTransaction {
10    /// The symbol of the waypoint where the transaction took place.
11    #[serde(rename = "waypointSymbol")]
12    pub waypoint_symbol: String,
13    /// The symbol of the ship that was the subject of the transaction.
14    #[serde(rename = "shipSymbol")]
15    pub ship_symbol: String,
16    /// The price of the transaction.
17    #[serde(rename = "price")]
18    pub price: u32,
19    /// The symbol of the agent that made the transaction.
20    #[serde(rename = "agentSymbol")]
21    pub agent_symbol: String,
22    /// The timestamp of the transaction.
23    #[serde(rename = "timestamp")]
24    pub timestamp: String,
25}
26
27impl ShipyardTransaction {
28    /// Create value with optional fields set to `None`.
29    #[allow(clippy::too_many_arguments)]
30    pub fn new(
31        waypoint_symbol: String,
32        ship_symbol: String,
33        price: u32,
34        agent_symbol: String,
35        timestamp: String,
36    ) -> ShipyardTransaction {
37        ShipyardTransaction {
38            waypoint_symbol,
39            ship_symbol,
40            price,
41            agent_symbol,
42            timestamp,
43        }
44    }
45}