/*
 * 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 DiskConfig {
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    #[serde(rename = "readonly", skip_serializing_if = "Option::is_none")]
    pub readonly: Option<bool>,
    #[serde(rename = "direct", skip_serializing_if = "Option::is_none")]
    pub direct: Option<bool>,
    #[serde(rename = "iommu", skip_serializing_if = "Option::is_none")]
    pub iommu: Option<bool>,
    #[serde(rename = "num_queues", skip_serializing_if = "Option::is_none")]
    pub num_queues: Option<i32>,
    #[serde(rename = "queue_size", skip_serializing_if = "Option::is_none")]
    pub queue_size: Option<i32>,
    #[serde(rename = "vhost_user", skip_serializing_if = "Option::is_none")]
    pub vhost_user: Option<bool>,
    #[serde(rename = "vhost_socket", skip_serializing_if = "Option::is_none")]
    pub vhost_socket: Option<String>,
    #[serde(
        rename = "rate_limiter_config",
        skip_serializing_if = "Option::is_none"
    )]
    pub rate_limiter_config: Option<models::RateLimiterConfig>,
    #[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 = "serial", skip_serializing_if = "Option::is_none")]
    pub serial: Option<String>,
    #[serde(rename = "rate_limit_group", skip_serializing_if = "Option::is_none")]
    pub rate_limit_group: Option<String>,
    #[serde(rename = "queue_affinity", skip_serializing_if = "Option::is_none")]
    pub queue_affinity: Option<Vec<models::VirtQueueAffinity>>,
    #[serde(rename = "backing_files", skip_serializing_if = "Option::is_none")]
    pub backing_files: Option<bool>,
    #[serde(rename = "sparse", skip_serializing_if = "Option::is_none")]
    pub sparse: Option<bool>,
    #[serde(rename = "image_type", skip_serializing_if = "Option::is_none")]
    pub image_type: Option<models::ImageType>,
    #[serde(rename = "lock_granularity", skip_serializing_if = "Option::is_none")]
    pub lock_granularity: Option<models::LockGranularity>,
}

impl DiskConfig {
    pub fn new() -> DiskConfig {
        DiskConfig {
            path: None,
            readonly: None,
            direct: None,
            iommu: None,
            num_queues: None,
            queue_size: None,
            vhost_user: None,
            vhost_socket: None,
            rate_limiter_config: None,
            pci_segment: None,
            pci_device_id: None,
            id: None,
            serial: None,
            rate_limit_group: None,
            queue_affinity: None,
            backing_files: None,
            sparse: None,
            image_type: None,
            lock_granularity: None,
        }
    }
}
