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 InstanceManagedByIgmErrorInstanceActionDetails {
    /// [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values:
    #[serde(rename = "action", skip_serializing_if = "Option::is_none")]
    pub action: Option<Action>,
    /// [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created.
    #[serde(rename = "instance", skip_serializing_if = "Option::is_none")]
    pub instance: Option<String>,
    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
    pub version: Option<Box<crate::google_rest_apis::compute_v1::models::ManagedInstanceVersion>>,
}

impl InstanceManagedByIgmErrorInstanceActionDetails {
    pub fn new() -> InstanceManagedByIgmErrorInstanceActionDetails {
        InstanceManagedByIgmErrorInstanceActionDetails {
            action: None,
            instance: None,
            version: None,
        }
    }
}

/// [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values:
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
    #[serde(rename = "ABANDONING")]
    Abandoning,
    #[serde(rename = "CREATING")]
    Creating,
    #[serde(rename = "CREATING_WITHOUT_RETRIES")]
    CreatingWithoutRetries,
    #[serde(rename = "DELETING")]
    Deleting,
    #[serde(rename = "NONE")]
    None,
    #[serde(rename = "RECREATING")]
    Recreating,
    #[serde(rename = "REFRESHING")]
    Refreshing,
    #[serde(rename = "RESTARTING")]
    Restarting,
    #[serde(rename = "RESUMING")]
    Resuming,
    #[serde(rename = "STARTING")]
    Starting,
    #[serde(rename = "STOPPING")]
    Stopping,
    #[serde(rename = "SUSPENDING")]
    Suspending,
    #[serde(rename = "VERIFYING")]
    Verifying,
}

impl Default for Action {
    fn default() -> Action {
        Self::Abandoning
    }
}
