space_traders/models/
market.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 Market {
10    /// The symbol of the market. The symbol is the same as the waypoint where the market is located.
11    #[serde(rename = "symbol")]
12    pub symbol: String,
13    /// The list of goods that are exported from this market.
14    #[serde(rename = "exports")]
15    pub exports: Vec<crate::models::TradeGood>,
16    /// The list of goods that are sought as imports in this market.
17    #[serde(rename = "imports")]
18    pub imports: Vec<crate::models::TradeGood>,
19    /// The list of goods that are bought and sold between agents at this market.
20    #[serde(rename = "exchange")]
21    pub exchange: Vec<crate::models::TradeGood>,
22    /// The list of recent transactions at this market. Visible only when a ship is present at the market.
23    #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
24    pub transactions: Option<Vec<crate::models::MarketTransaction>>,
25    /// The list of goods that are traded at this market. Visible only when a ship is present at the market.
26    #[serde(rename = "tradeGoods", skip_serializing_if = "Option::is_none")]
27    pub trade_goods: Option<Vec<crate::models::MarketTradeGood>>,
28}
29
30impl Market {
31    /// Create value with optional fields set to `None`.
32    #[allow(clippy::too_many_arguments)]
33    pub fn new(
34        symbol: String,
35        exports: Vec<crate::models::TradeGood>,
36        imports: Vec<crate::models::TradeGood>,
37        exchange: Vec<crate::models::TradeGood>,
38    ) -> Market {
39        Market {
40            symbol,
41            exports,
42            imports,
43            exchange,
44            transactions: None,
45            trade_goods: None,
46        }
47    }
48}