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 Market {
    /// The symbol of the market. The symbol is the same as the waypoint where the market is located.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The list of goods that are exported from this market.
    #[serde(rename = "exports")]
    pub exports: Vec<crate::models::TradeGood>,
    /// The list of goods that are sought as imports in this market.
    #[serde(rename = "imports")]
    pub imports: Vec<crate::models::TradeGood>,
    /// The list of goods that are bought and sold between agents at this market.
    #[serde(rename = "exchange")]
    pub exchange: Vec<crate::models::TradeGood>,
    /// The list of recent transactions at this market. Visible only when a ship is present at the market.
    #[serde(rename = "transactions", skip_serializing_if = "Option::is_none")]
    pub transactions: Option<Vec<crate::models::MarketTransaction>>,
    /// The list of goods that are traded at this market. Visible only when a ship is present at the market.
    #[serde(rename = "tradeGoods", skip_serializing_if = "Option::is_none")]
    pub trade_goods: Option<Vec<crate::models::MarketTradeGood>>,
}

impl Market {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: String,
        exports: Vec<crate::models::TradeGood>,
        imports: Vec<crate::models::TradeGood>,
        exchange: Vec<crate::models::TradeGood>,
    ) -> Market {
        Market {
            symbol,
            exports,
            imports,
            exchange,
            transactions: None,
            trade_goods: None,
        }
    }
}