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
                                      */

use crate::google_rest_apis::compute_v1::models;

/// AllocationAggregateReservation : This reservation type is specified by total resource amounts (e.g. total count of CPUs) and can account for multiple instance SKUs. In other words, one can create instances of varying shapes against this reservation.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AllocationAggregateReservation {
    /// [Output only] List of resources currently in use.
    #[serde(rename = "inUseResources", skip_serializing_if = "Option::is_none")]
    pub in_use_resources: Option<Vec<models::AllocationAggregateReservationReservedResourceInfo>>,
    /// List of reserved resources (CPUs, memory, accelerators).
    #[serde(rename = "reservedResources", skip_serializing_if = "Option::is_none")]
    pub reserved_resources: Option<Vec<models::AllocationAggregateReservationReservedResourceInfo>>,
    /// The VM family that all instances scheduled against this reservation must belong to.
    #[serde(rename = "vmFamily", skip_serializing_if = "Option::is_none")]
    pub vm_family: Option<VmFamily>,
    /// The workload type of the instances that will target this reservation.
    #[serde(rename = "workloadType", skip_serializing_if = "Option::is_none")]
    pub workload_type: Option<WorkloadType>,
}

impl AllocationAggregateReservation {
    /// This reservation type is specified by total resource amounts (e.g. total count of CPUs) and can account for multiple instance SKUs. In other words, one can create instances of varying shapes against this reservation.
    pub fn new() -> AllocationAggregateReservation {
        AllocationAggregateReservation {
            in_use_resources: None,
            reserved_resources: None,
            vm_family: None,
            workload_type: None,
        }
    }
}
/// The VM family that all instances scheduled against this reservation must belong to.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VmFamily {
    #[serde(rename = "VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L")]
    LiteDeviceCt5L,
    #[serde(rename = "VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP")]
    LitePodSliceCt5Lp,
    #[serde(rename = "VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P")]
    PodSliceCt4P,
}

impl Default for VmFamily {
    fn default() -> VmFamily {
        Self::LiteDeviceCt5L
    }
}
/// The workload type of the instances that will target this reservation.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WorkloadType {
    #[serde(rename = "BATCH")]
    Batch,
    #[serde(rename = "SERVING")]
    Serving,
    #[serde(rename = "UNSPECIFIED")]
    Unspecified,
}

impl Default for WorkloadType {
    fn default() -> WorkloadType {
        Self::Batch
    }
}
