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

/// SavedAttachedDisk : DEPRECATED: Please use compute#savedDisk instead. An instance-attached disk resource.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SavedAttachedDisk {
    /// Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance).
    #[serde(rename = "autoDelete", skip_serializing_if = "Option::is_none")]
    pub auto_delete: Option<bool>,
    /// Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem.
    #[serde(rename = "boot", skip_serializing_if = "Option::is_none")]
    pub boot: Option<bool>,
    /// Specifies the name of the disk attached to the source instance.
    #[serde(rename = "deviceName", skip_serializing_if = "Option::is_none")]
    pub device_name: Option<String>,
    #[serde(rename = "diskEncryptionKey", skip_serializing_if = "Option::is_none")]
    pub disk_encryption_key:
        Option<Box<crate::google_rest_apis::compute_v1::models::CustomerEncryptionKey>>,
    /// The size of the disk in base-2 GB.
    #[serde(rename = "diskSizeGb", skip_serializing_if = "Option::is_none")]
    pub disk_size_gb: Option<String>,
    /// [Output Only] URL of the disk type resource. For example: projects/project /zones/zone/diskTypes/pd-standard or pd-ssd
    #[serde(rename = "diskType", skip_serializing_if = "Option::is_none")]
    pub disk_type: Option<String>,
    /// A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
    #[serde(rename = "guestOsFeatures", skip_serializing_if = "Option::is_none")]
    pub guest_os_features: Option<Vec<crate::google_rest_apis::compute_v1::models::GuestOsFeature>>,
    /// Specifies zero-based index of the disk that is attached to the source instance.
    #[serde(rename = "index", skip_serializing_if = "Option::is_none")]
    pub index: Option<i32>,
    /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME.
    #[serde(rename = "interface", skip_serializing_if = "Option::is_none")]
    pub interface: Option<Interface>,
    /// [Output Only] Type of the resource. Always compute#attachedDisk for attached disks.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// [Output Only] Any valid publicly visible licenses.
    #[serde(rename = "licenses", skip_serializing_if = "Option::is_none")]
    pub licenses: Option<Vec<String>>,
    /// The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY.
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Mode>,
    /// Specifies a URL of the disk attached to the source instance.
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// [Output Only] A size of the storage used by the disk's snapshot by this machine image.
    #[serde(rename = "storageBytes", skip_serializing_if = "Option::is_none")]
    pub storage_bytes: Option<String>,
    /// [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.
    #[serde(rename = "storageBytesStatus", skip_serializing_if = "Option::is_none")]
    pub storage_bytes_status: Option<StorageBytesStatus>,
    /// Specifies the type of the attached disk, either SCRATCH or PERSISTENT.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
}

impl SavedAttachedDisk {
    /// DEPRECATED: Please use compute#savedDisk instead. An instance-attached disk resource.
    pub fn new() -> SavedAttachedDisk {
        SavedAttachedDisk {
            auto_delete: None,
            boot: None,
            device_name: None,
            disk_encryption_key: None,
            disk_size_gb: None,
            disk_type: None,
            guest_os_features: None,
            index: None,
            interface: None,
            kind: None,
            licenses: None,
            mode: None,
            source: None,
            storage_bytes: None,
            storage_bytes_status: None,
            r#type: None,
        }
    }
}

/// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Interface {
    #[serde(rename = "NVME")]
    Nvme,
    #[serde(rename = "SCSI")]
    Scsi,
}

impl Default for Interface {
    fn default() -> Interface {
        Self::Nvme
    }
}
/// The mode in which this disk is attached to the source instance, either READ_WRITE or READ_ONLY.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
    #[serde(rename = "READ_ONLY")]
    Only,
    #[serde(rename = "READ_WRITE")]
    Write,
}

impl Default for Mode {
    fn default() -> Mode {
        Self::Only
    }
}
/// [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StorageBytesStatus {
    #[serde(rename = "UPDATING")]
    Updating,
    #[serde(rename = "UP_TO_DATE")]
    UpToDate,
}

impl Default for StorageBytesStatus {
    fn default() -> StorageBytesStatus {
        Self::Updating
    }
}
/// Specifies the type of the attached disk, either SCRATCH or PERSISTENT.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "PERSISTENT")]
    Persistent,
    #[serde(rename = "SCRATCH")]
    Scratch,
}

impl Default for Type {
    fn default() -> Type {
        Self::Persistent
    }
}
