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};

/// Agent details.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Agent {
    /// Account ID that is tied to this agent. Only included on your own agent.
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// Symbol of the agent.
    #[serde(rename = "symbol")]
    pub symbol: String,
    /// The headquarters of the agent.
    #[serde(rename = "headquarters")]
    pub headquarters: String,
    /// The number of credits the agent has available. Credits can be negative if funds have been overdrawn.
    #[serde(rename = "credits")]
    pub credits: i64,
    /// The faction the agent started with.
    #[serde(rename = "startingFaction")]
    pub starting_faction: String,
    /// How many ships are owned by the agent.
    #[serde(rename = "shipCount", skip_serializing_if = "Option::is_none")]
    pub ship_count: Option<i32>,
}

impl Agent {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(
        symbol: String,
        headquarters: String,
        credits: i64,
        starting_faction: String,
    ) -> Agent {
        Agent {
            account_id: None,
            symbol,
            headquarters,
            credits,
            starting_faction,
            ship_count: None,
        }
    }
}