/*
 * Cloud Hypervisor API
 *
 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
 *
 * The version of the OpenAPI document: 0.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeviceConfig {
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "iommu", skip_serializing_if = "Option::is_none")]
    pub iommu: Option<bool>,
    #[serde(rename = "pci_segment", skip_serializing_if = "Option::is_none")]
    pub pci_segment: Option<i16>,
    #[serde(rename = "pci_device_id", skip_serializing_if = "Option::is_none")]
    pub pci_device_id: Option<u8>,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(
        rename = "x_nv_gpudirect_clique",
        skip_serializing_if = "Option::is_none"
    )]
    pub x_nv_gpudirect_clique: Option<i8>,
    #[serde(
        rename = "x_exclude_mmap_bars",
        skip_serializing_if = "Option::is_none"
    )]
    pub x_exclude_mmap_bars: Option<Vec<i64>>,
}

impl DeviceConfig {
    pub fn new(path: String) -> DeviceConfig {
        DeviceConfig {
            path,
            iommu: None,
            pci_segment: None,
            pci_device_id: None,
            id: None,
            x_nv_gpudirect_clique: None,
            x_exclude_mmap_bars: None,
        }
    }
}
