/*
 * 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 PmemConfig {
    #[serde(rename = "file")]
    pub file: String,
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<i64>,
    #[serde(rename = "iommu", skip_serializing_if = "Option::is_none")]
    pub iommu: Option<bool>,
    #[serde(rename = "discard_writes", skip_serializing_if = "Option::is_none")]
    pub discard_writes: 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>,
}

impl PmemConfig {
    pub fn new(file: String) -> PmemConfig {
        PmemConfig {
            file,
            size: None,
            iommu: None,
            discard_writes: None,
            pci_segment: None,
            pci_device_id: None,
            id: None,
        }
    }
}
