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

/// AttachedDisk : An instance-attached disk resource.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct AttachedDisk {
    /// [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64.
    #[serde(rename = "architecture", skip_serializing_if = "Option::is_none")]
    pub architecture: Option<Architecture>,
    /// 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 a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks.
    #[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 GB.
    #[serde(rename = "diskSizeGb", skip_serializing_if = "Option::is_none")]
    pub disk_size_gb: Option<String>,
    /// [Input Only] Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error.
    #[serde(rename = "forceAttach", skip_serializing_if = "Option::is_none")]
    pub force_attach: Option<bool>,
    /// 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>>,
    /// [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number.
    #[serde(rename = "index", skip_serializing_if = "Option::is_none")]
    pub index: Option<i32>,
    #[serde(rename = "initializeParams", skip_serializing_if = "Option::is_none")]
    pub initialize_params:
        Option<Box<crate::google_rest_apis::compute_v1::models::AttachedDiskInitializeParams>>,
    /// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks.
    #[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 to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Mode>,
    /// For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api.
    #[serde(rename = "savedState", skip_serializing_if = "Option::is_none")]
    pub saved_state: Option<SavedState>,
    #[serde(
        rename = "shieldedInstanceInitialState",
        skip_serializing_if = "Option::is_none"
    )]
    pub shielded_instance_initial_state:
        Option<Box<crate::google_rest_apis::compute_v1::models::InitialStateConfig>>,
    /// Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. Note that for InstanceTemplate, specify the disk name for zonal disk, and the URL for regional disk.
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<Type>,
}

impl AttachedDisk {
    /// An instance-attached disk resource.
    pub fn new() -> AttachedDisk {
        AttachedDisk {
            architecture: None,
            auto_delete: None,
            boot: None,
            device_name: None,
            disk_encryption_key: None,
            disk_size_gb: None,
            force_attach: None,
            guest_os_features: None,
            index: None,
            initialize_params: None,
            interface: None,
            kind: None,
            licenses: None,
            mode: None,
            saved_state: None,
            shielded_instance_initial_state: None,
            source: None,
            r#type: None,
        }
    }
}

/// [Output Only] The architecture of the attached disk. Valid values are ARM64 or X86_64.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Architecture {
    #[serde(rename = "ARCHITECTURE_UNSPECIFIED")]
    ArchitectureUnspecified,
    #[serde(rename = "ARM64")]
    Arm64,
    #[serde(rename = "X86_64")]
    X8664,
}

impl Default for Architecture {
    fn default() -> Architecture {
        Self::ArchitectureUnspecified
    }
}
/// Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. For most machine types, the default is SCSI. Local SSDs can use either NVME or SCSI. In certain configurations, persistent disks can use NVMe. For more information, see About persistent disks.
#[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 to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.
#[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
    }
}
/// For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SavedState {
    #[serde(rename = "DISK_SAVED_STATE_UNSPECIFIED")]
    DiskSavedStateUnspecified,
    #[serde(rename = "PRESERVED")]
    Preserved,
}

impl Default for SavedState {
    fn default() -> SavedState {
        Self::DiskSavedStateUnspecified
    }
}
/// Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is 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
    }
}
