/*
 * Mithril
 *
 * Mithril Compute API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateApiKeyResponse {
    #[serde(rename = "fid")]
    pub fid: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "expires_at")]
    pub expires_at: String,
    #[serde(rename = "deactivated_at", skip_serializing_if = "Option::is_none")]
    pub deactivated_at: Option<String>,
    #[serde(rename = "snippet")]
    pub snippet: String,
    #[serde(rename = "secret")]
    pub secret: String,
}

impl CreateApiKeyResponse {
    pub fn new(
        fid: String,
        name: String,
        created_at: String,
        expires_at: String,
        snippet: String,
        secret: String,
    ) -> CreateApiKeyResponse {
        CreateApiKeyResponse {
            fid,
            name,
            created_at,
            expires_at,
            deactivated_at: None,
            snippet,
            secret,
        }
    }
}
