space_traders/models/
agent.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// Agent details.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct Agent {
10    /// Account ID that is tied to this agent. Only included on your own agent.
11    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
12    pub account_id: Option<String>,
13    /// Symbol of the agent.
14    #[serde(rename = "symbol")]
15    pub symbol: String,
16    /// The headquarters of the agent.
17    #[serde(rename = "headquarters")]
18    pub headquarters: String,
19    /// The number of credits the agent has available. Credits can be negative if funds have been overdrawn.
20    #[serde(rename = "credits")]
21    pub credits: i64,
22    /// The faction the agent started with.
23    #[serde(rename = "startingFaction")]
24    pub starting_faction: String,
25    /// How many ships are owned by the agent.
26    #[serde(rename = "shipCount", skip_serializing_if = "Option::is_none")]
27    pub ship_count: Option<i32>,
28}
29
30impl Agent {
31    /// Create value with optional fields set to `None`.
32    #[allow(clippy::too_many_arguments)]
33    pub fn new(
34        symbol: String,
35        headquarters: String,
36        credits: i64,
37        starting_faction: String,
38    ) -> Agent {
39        Agent {
40            account_id: None,
41            symbol,
42            headquarters,
43            credits,
44            starting_faction,
45            ship_count: None,
46        }
47    }
48}