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 SnapshotSettingsStorageLocationSettings {
    /// When the policy is SPECIFIC_LOCATIONS, snapshots will be stored in the locations listed in this field. Keys are GCS bucket locations.
    #[serde(rename = "locations", skip_serializing_if = "Option::is_none")]
    pub locations: Option<::std::collections::HashMap<String, crate::google_rest_apis::compute_v1::models::SnapshotSettingsStorageLocationSettingsStorageLocationPreference>>,
    /// The chosen location policy.
    #[serde(rename = "policy", skip_serializing_if = "Option::is_none")]
    pub policy: Option<Policy>,
}

impl SnapshotSettingsStorageLocationSettings {
    pub fn new() -> SnapshotSettingsStorageLocationSettings {
        SnapshotSettingsStorageLocationSettings {
            locations: None,
            policy: None,
        }
    }
}

/// The chosen location policy.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Policy {
    #[serde(rename = "LOCAL_REGION")]
    LocalRegion,
    #[serde(rename = "NEAREST_MULTI_REGION")]
    NearestMultiRegion,
    #[serde(rename = "SPECIFIC_LOCATIONS")]
    SpecificLocations,
    #[serde(rename = "STORAGE_LOCATION_POLICY_UNSPECIFIED")]
    StorageLocationPolicyUnspecified,
}

impl Default for Policy {
    fn default() -> Policy {
        Self::LocalRegion
    }
}
