/*
 * 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 BalloonConfig {
    #[serde(rename = "size")]
    pub size: i64,
    /// Deflate balloon when the guest is under memory pressure.
    #[serde(rename = "deflate_on_oom", skip_serializing_if = "Option::is_none")]
    pub deflate_on_oom: Option<bool>,
    /// Enable guest to report free pages.
    #[serde(
        rename = "free_page_reporting",
        skip_serializing_if = "Option::is_none"
    )]
    pub free_page_reporting: Option<bool>,
}

impl BalloonConfig {
    pub fn new(size: i64) -> BalloonConfig {
        BalloonConfig {
            size,
            deflate_on_oom: None,
            free_page_reporting: None,
        }
    }
}
