spacedust/models/contract_deliver_good.rs
1/*
2 * SpaceTraders API
3 *
4 * SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe. The API is documented using [OpenAPI](https://github.com/SpaceTradersAPI/api-docs). You can send your first request right here in your browser to check the status of the game server. ```json http { \"method\": \"GET\", \"url\": \"https://api.spacetraders.io/v2\", } ``` Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community. We have a [Discord channel](https://discord.com/invite/jh6zurdWk5) where you can share your projects, ask questions, and get help from other players.
5 *
6 * The version of the OpenAPI document: 2.0.0
7 * Contact: joel@spacetraders.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// ContractDeliverGood : The details of a delivery contract. Includes the type of good, units needed, and the destination.
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct ContractDeliverGood {
17 /// The symbol of the trade good to deliver.
18 #[serde(rename = "tradeSymbol")]
19 pub trade_symbol: String,
20 /// The destination where goods need to be delivered.
21 #[serde(rename = "destinationSymbol")]
22 pub destination_symbol: String,
23 /// The number of units that need to be delivered on this contract.
24 #[serde(rename = "unitsRequired")]
25 pub units_required: i32,
26 /// The number of units fulfilled on this contract.
27 #[serde(rename = "unitsFulfilled")]
28 pub units_fulfilled: i32,
29}
30
31impl ContractDeliverGood {
32 /// The details of a delivery contract. Includes the type of good, units needed, and the destination.
33 pub fn new(trade_symbol: String, destination_symbol: String, units_required: i32, units_fulfilled: i32) -> ContractDeliverGood {
34 ContractDeliverGood {
35 trade_symbol,
36 destination_symbol,
37 units_required,
38 units_fulfilled,
39 }
40 }
41}
42
43