use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InstanceGroupManagerInstanceLifecyclePolicy {
    /// A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
    #[serde(
        rename = "forceUpdateOnRepair",
        skip_serializing_if = "Option::is_none"
    )]
    pub force_update_on_repair: Option<ForceUpdateOnRepair>,
}

impl InstanceGroupManagerInstanceLifecyclePolicy {
    pub fn new() -> InstanceGroupManagerInstanceLifecyclePolicy {
        InstanceGroupManagerInstanceLifecyclePolicy {
            force_update_on_repair: None,
        }
    }
}

/// A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForceUpdateOnRepair {
    #[serde(rename = "false")]
    False,
    #[serde(rename = "true")]
    True,
}

impl Default for ForceUpdateOnRepair {
    fn default() -> ForceUpdateOnRepair {
        Self::False
    }
}
