/*
 * 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 InstanceTypeModel {
    #[serde(rename = "fid")]
    pub fid: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "num_cpus")]
    pub num_cpus: i32,
    #[serde(rename = "cpu_type")]
    pub cpu_type: String,
    #[serde(rename = "ram_gb")]
    pub ram_gb: i32,
    #[serde(rename = "num_gpus")]
    pub num_gpus: i32,
    #[serde(rename = "gpu_type")]
    pub gpu_type: String,
    #[serde(rename = "gpu_memory_gb")]
    pub gpu_memory_gb: i32,
    #[serde(rename = "gpu_socket")]
    pub gpu_socket: String,
    #[serde(rename = "local_storage_gb")]
    pub local_storage_gb: i32,
    #[serde(rename = "network_type", skip_serializing_if = "Option::is_none")]
    pub network_type: Option<String>,
    #[serde(rename = "ib_count")]
    pub ib_count: i32,
    #[serde(rename = "bridge_count")]
    pub bridge_count: i32,
}

impl InstanceTypeModel {
    pub fn new(
        fid: String,
        name: String,
        num_cpus: i32,
        cpu_type: String,
        ram_gb: i32,
        num_gpus: i32,
        gpu_type: String,
        gpu_memory_gb: i32,
        gpu_socket: String,
        local_storage_gb: i32,
        ib_count: i32,
        bridge_count: i32,
    ) -> InstanceTypeModel {
        InstanceTypeModel {
            fid,
            name,
            num_cpus,
            cpu_type,
            ram_gb,
            num_gpus,
            gpu_type,
            gpu_memory_gb,
            gpu_socket,
            local_storage_gb,
            network_type: None,
            ib_count,
            bridge_count,
        }
    }
}
