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 BulkInsertOperationStatus {
    /// [Output Only] Count of VMs successfully created so far.
    #[serde(rename = "createdVmCount", skip_serializing_if = "Option::is_none")]
    pub created_vm_count: Option<i32>,
    /// [Output Only] Count of VMs that got deleted during rollback.
    #[serde(rename = "deletedVmCount", skip_serializing_if = "Option::is_none")]
    pub deleted_vm_count: Option<i32>,
    /// [Output Only] Count of VMs that started creating but encountered an error.
    #[serde(
        rename = "failedToCreateVmCount",
        skip_serializing_if = "Option::is_none"
    )]
    pub failed_to_create_vm_count: Option<i32>,
    /// [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// [Output Only] Count of VMs originally planned to be created.
    #[serde(rename = "targetVmCount", skip_serializing_if = "Option::is_none")]
    pub target_vm_count: Option<i32>,
}

impl BulkInsertOperationStatus {
    pub fn new() -> BulkInsertOperationStatus {
        BulkInsertOperationStatus {
            created_vm_count: None,
            deleted_vm_count: None,
            failed_to_create_vm_count: None,
            status: None,
            target_vm_count: None,
        }
    }
}

/// [Output Only] Creation status of BulkInsert operation - information if the flow is rolling forward or rolling back.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "CREATING")]
    Creating,
    #[serde(rename = "DONE")]
    Done,
    #[serde(rename = "ROLLING_BACK")]
    RollingBack,
    #[serde(rename = "STATUS_UNSPECIFIED")]
    StatusUnspecified,
}

impl Default for Status {
    fn default() -> Status {
        Self::Creating
    }
}
