space_traders_api/models/
survey.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.3.0
7 * Contact: joel@spacetraders.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Survey : A resource survey of a waypoint, detailing a specific extraction location and the types of resources that can be found there.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Survey {
17    /// A unique signature for the location of this survey. This signature is verified when attempting an extraction using this survey.
18    #[serde(rename = "signature")]
19    pub signature: String,
20    /// The symbol of the waypoint that this survey is for.
21    #[serde(rename = "symbol")]
22    pub symbol: String,
23    /// A list of deposits that can be found at this location. A ship will extract one of these deposits when using this survey in an extraction request. If multiple deposits of the same type are present, the chance of extracting that deposit is increased.
24    #[serde(rename = "deposits")]
25    pub deposits: Vec<models::SurveyDeposit>,
26    /// The date and time when the survey expires. After this date and time, the survey will no longer be available for extraction.
27    #[serde(rename = "expiration")]
28    pub expiration: String,
29    /// The size of the deposit. This value indicates how much can be extracted from the survey before it is exhausted.
30    #[serde(rename = "size")]
31    pub size: Size,
32}
33
34impl Survey {
35    /// A resource survey of a waypoint, detailing a specific extraction location and the types of resources that can be found there.
36    pub fn new(signature: String, symbol: String, deposits: Vec<models::SurveyDeposit>, expiration: String, size: Size) -> Survey {
37        Survey {
38            signature,
39            symbol,
40            deposits,
41            expiration,
42            size,
43        }
44    }
45}
46/// The size of the deposit. This value indicates how much can be extracted from the survey before it is exhausted.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Size {
49    #[serde(rename = "SMALL")]
50    Small,
51    #[serde(rename = "MODERATE")]
52    Moderate,
53    #[serde(rename = "LARGE")]
54    Large,
55}
56
57impl Default for Size {
58    fn default() -> Size {
59        Self::Small
60    }
61}
62