/*
 * This is an auto-generated file.
 * Any manual changes may be overwritten without notice!
 */

use derive_builder::Builder;
use serde::{Deserialize, Serialize};

/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct License {
    /// The time at which the license starts being valid
    #[serde(rename = "StartTime")]
    pub start_time: chrono::DateTime<chrono::Utc>,

    /// The time at which the license ceases to function and can
    /// no longer be used in any capacity
    #[serde(rename = "TerminationTime")]
    pub termination_time: chrono::DateTime<chrono::Utc>,

    /// The product the license is valid for
    #[serde(rename = "Product")]
    pub product: String,

    /// License Specific Flags
    #[serde(rename = "Flags")]
    pub flags: std::collections::HashMap<String, serde_json::Value>,

    /// Modules is a list of the licensed enterprise modules
    #[serde(
        rename = "Modules",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub modules: Vec<String>,

    /// The unique identifier of the license
    #[serde(rename = "LicenseID")]
    pub license_id: String,

    /// If set, an identifier that should be used to lock the license to a
    /// particular site, cluster, etc.
    #[serde(rename = "InstallationID")]
    pub installation_id: String,

    /// The time at which the license was issued
    #[serde(rename = "IssueTime")]
    pub issue_time: chrono::DateTime<chrono::Utc>,

    /// The customer ID associated with the license
    #[serde(rename = "CustomerID")]
    pub customer_id: String,

    /// The time after which the license expires
    #[serde(rename = "ExpirationTime")]
    pub expiration_time: chrono::DateTime<chrono::Utc>,

    /// List of features enabled by the license
    #[serde(
        rename = "Features",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub features: Vec<String>,
}
