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

/// A cooldown is a period of time in which a ship cannot perform certain actions.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Cooldown {
    /// The symbol of the ship that is on cooldown
    #[serde(rename = "shipSymbol")]
    pub ship_symbol: String,
    /// The total duration of the cooldown in seconds
    #[serde(rename = "totalSeconds")]
    pub total_seconds: u32,
    /// The remaining duration of the cooldown in seconds
    #[serde(rename = "remainingSeconds")]
    pub remaining_seconds: u32,
    /// The date and time when the cooldown expires in ISO 8601 format
    #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
    pub expiration: Option<String>,
}

impl Cooldown {
    /// Create value with optional fields set to `None`.
    #[allow(clippy::too_many_arguments)]
    pub fn new(ship_symbol: String, total_seconds: u32, remaining_seconds: u32) -> Cooldown {
        Cooldown {
            ship_symbol,
            total_seconds,
            remaining_seconds,
            expiration: None,
        }
    }
}