#[non_exhaustive]pub struct ResourcePolicySnapshotSchedulePolicyRetentionPolicy {
pub max_retention_days: Option<i32>,
pub on_source_disk_delete: Option<OnSourceDiskDelete>,
/* private fields */
}Available on crate feature
resource-policies only.Expand description
Policy for retention of scheduled snapshots.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_retention_days: Option<i32>Maximum age of the snapshot that is allowed to be kept.
on_source_disk_delete: Option<OnSourceDiskDelete>Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
Implementations§
Source§impl ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl ResourcePolicySnapshotSchedulePolicyRetentionPolicy
pub fn new() -> Self
Sourcepub fn set_max_retention_days<T>(self, v: T) -> Self
pub fn set_max_retention_days<T>(self, v: T) -> Self
Sets the value of max_retention_days.
§Example
ⓘ
let x = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_max_retention_days(42);Sourcepub fn set_or_clear_max_retention_days<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_retention_days<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_retention_days.
§Example
ⓘ
let x = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_or_clear_max_retention_days(Some(42));
let x = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_or_clear_max_retention_days(None::<i32>);Sourcepub fn set_on_source_disk_delete<T>(self, v: T) -> Selfwhere
T: Into<OnSourceDiskDelete>,
pub fn set_on_source_disk_delete<T>(self, v: T) -> Selfwhere
T: Into<OnSourceDiskDelete>,
Sets the value of on_source_disk_delete.
§Example
ⓘ
use google_cloud_compute_v1::model::resource_policy_snapshot_schedule_policy_retention_policy::OnSourceDiskDelete;
let x0 = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_on_source_disk_delete(OnSourceDiskDelete::KeepAutoSnapshots);
let x1 = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_on_source_disk_delete(OnSourceDiskDelete::UnspecifiedOnSourceDiskDelete);Sourcepub fn set_or_clear_on_source_disk_delete<T>(self, v: Option<T>) -> Selfwhere
T: Into<OnSourceDiskDelete>,
pub fn set_or_clear_on_source_disk_delete<T>(self, v: Option<T>) -> Selfwhere
T: Into<OnSourceDiskDelete>,
Sets or clears the value of on_source_disk_delete.
§Example
ⓘ
use google_cloud_compute_v1::model::resource_policy_snapshot_schedule_policy_retention_policy::OnSourceDiskDelete;
let x0 = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_or_clear_on_source_disk_delete(Some(OnSourceDiskDelete::KeepAutoSnapshots));
let x1 = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_or_clear_on_source_disk_delete(Some(OnSourceDiskDelete::UnspecifiedOnSourceDiskDelete));
let x_none = ResourcePolicySnapshotSchedulePolicyRetentionPolicy::new().set_or_clear_on_source_disk_delete(None::<OnSourceDiskDelete>);Trait Implementations§
Source§impl Clone for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl Clone for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Source§fn clone(&self) -> ResourcePolicySnapshotSchedulePolicyRetentionPolicy
fn clone(&self) -> ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl Default for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Source§fn default() -> ResourcePolicySnapshotSchedulePolicyRetentionPolicy
fn default() -> ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl PartialEq for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Source§fn eq(
&self,
other: &ResourcePolicySnapshotSchedulePolicyRetentionPolicy,
) -> bool
fn eq( &self, other: &ResourcePolicySnapshotSchedulePolicyRetentionPolicy, ) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Auto Trait Implementations§
impl Freeze for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl RefUnwindSafe for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl Send for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl Sync for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl Unpin for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
impl UnwindSafe for ResourcePolicySnapshotSchedulePolicyRetentionPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more