/*
 * 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 CreatedSshKeyModel {
    #[serde(rename = "fid")]
    pub fid: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "project")]
    pub project: String,
    #[serde(rename = "public_key")]
    pub public_key: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "required")]
    pub required: bool,
    #[serde(rename = "private_key", skip_serializing_if = "Option::is_none")]
    pub private_key: Option<String>,
}

impl CreatedSshKeyModel {
    pub fn new(
        fid: String,
        name: String,
        project: String,
        public_key: String,
        created_at: String,
        required: bool,
    ) -> CreatedSshKeyModel {
        CreatedSshKeyModel {
            fid,
            name,
            project,
            public_key,
            created_at,
            required,
            private_key: None,
        }
    }
}
