/*
 * 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 GenericVhostUserConfig {
    #[serde(rename = "socket")]
    pub socket: String,
    #[serde(rename = "queue_size", skip_serializing_if = "Option::is_none")]
    pub queue_size: Option<Vec<u16>>,
    #[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 = "virtio_id")]
    pub virtio_id: u32,
}

impl GenericVhostUserConfig {
    pub fn new(socket: String, virtio_id: u32) -> GenericVhostUserConfig {
        GenericVhostUserConfig {
            socket,
            queue_size: None,
            pci_segment: None,
            pci_device_id: None,
            virtio_id,
        }
    }
}
