space_traders/models/
contract_deliver_good.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// The details of a delivery contract. Includes the type of good, units needed, and the destination.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct ContractDeliverGood {
10    /// The symbol of the trade good to deliver.
11    #[serde(rename = "tradeSymbol")]
12    pub trade_symbol: String,
13    /// The destination where goods need to be delivered.
14    #[serde(rename = "destinationSymbol")]
15    pub destination_symbol: String,
16    /// The number of units that need to be delivered on this contract.
17    #[serde(rename = "unitsRequired")]
18    pub units_required: i32,
19    /// The number of units fulfilled on this contract.
20    #[serde(rename = "unitsFulfilled")]
21    pub units_fulfilled: i32,
22}
23
24impl ContractDeliverGood {
25    /// Create value with optional fields set to `None`.
26    #[allow(clippy::too_many_arguments)]
27    pub fn new(
28        trade_symbol: String,
29        destination_symbol: String,
30        units_required: i32,
31        units_fulfilled: i32,
32    ) -> ContractDeliverGood {
33        ContractDeliverGood {
34            trade_symbol,
35            destination_symbol,
36            units_required,
37            units_fulfilled,
38        }
39    }
40}