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;

/// ResourcePolicySnapshotSchedulePolicyRetentionPolicy : Policy for retention of scheduled snapshots.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResourcePolicySnapshotSchedulePolicyRetentionPolicy {
    /// Maximum age of the snapshot that is allowed to be kept.
    #[serde(rename = "maxRetentionDays", skip_serializing_if = "Option::is_none")]
    pub max_retention_days: Option<i32>,
    /// Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
    #[serde(rename = "onSourceDiskDelete", skip_serializing_if = "Option::is_none")]
    pub on_source_disk_delete: Option<OnSourceDiskDelete>,
}

impl ResourcePolicySnapshotSchedulePolicyRetentionPolicy {
    /// Policy for retention of scheduled snapshots.
    pub fn new() -> ResourcePolicySnapshotSchedulePolicyRetentionPolicy {
        ResourcePolicySnapshotSchedulePolicyRetentionPolicy {
            max_retention_days: None,
            on_source_disk_delete: None,
        }
    }
}
/// Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum OnSourceDiskDelete {
    #[serde(rename = "APPLY_RETENTION_POLICY")]
    ApplyRetentionPolicy,
    #[serde(rename = "KEEP_AUTO_SNAPSHOTS")]
    KeepAutoSnapshots,
    #[serde(rename = "UNSPECIFIED_ON_SOURCE_DISK_DELETE")]
    UnspecifiedOnSourceDiskDelete,
}

impl Default for OnSourceDiskDelete {
    fn default() -> OnSourceDiskDelete {
        Self::ApplyRetentionPolicy
    }
}
