#[non_exhaustive]pub struct BackupPolicy {
pub name: String,
pub daily_backup_limit: Option<i32>,
pub weekly_backup_limit: Option<i32>,
pub monthly_backup_limit: Option<i32>,
pub description: Option<String>,
pub enabled: Option<bool>,
pub assigned_volume_count: Option<i32>,
pub create_time: Option<Timestamp>,
pub labels: HashMap<String, String>,
pub state: State,
/* private fields */
}Expand description
Backup Policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. The resource name of the backup policy.
Format:
projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}.
daily_backup_limit: Option<i32>Number of daily backups to keep. Note that the minimum daily backup limit is 2.
weekly_backup_limit: Option<i32>Number of weekly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
monthly_backup_limit: Option<i32>Number of monthly backups to keep. Note that the sum of daily, weekly and monthly backups should be greater than 1.
description: Option<String>Description of the backup policy.
enabled: Option<bool>If enabled, make backups automatically according to the schedules. This will be applied to all volumes that have this policy attached and enforced on volume level. If not specified, default is true.
assigned_volume_count: Option<i32>Output only. The total number of volumes assigned by this backup policy.
create_time: Option<Timestamp>Output only. The time when the backup policy was created.
labels: HashMap<String, String>Resource labels to represent user provided metadata.
state: StateOutput only. The backup policy state.
Implementations§
Source§impl BackupPolicy
impl BackupPolicy
pub fn new() -> Self
Sourcepub fn set_daily_backup_limit<T>(self, v: T) -> Self
pub fn set_daily_backup_limit<T>(self, v: T) -> Self
Sets the value of daily_backup_limit.
§Example
let x = BackupPolicy::new().set_daily_backup_limit(42);Sourcepub fn set_or_clear_daily_backup_limit<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_daily_backup_limit<T>(self, v: Option<T>) -> Self
Sets or clears the value of daily_backup_limit.
§Example
let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);Sourcepub fn set_weekly_backup_limit<T>(self, v: T) -> Self
pub fn set_weekly_backup_limit<T>(self, v: T) -> Self
Sets the value of weekly_backup_limit.
§Example
let x = BackupPolicy::new().set_weekly_backup_limit(42);Sourcepub fn set_or_clear_weekly_backup_limit<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_weekly_backup_limit<T>(self, v: Option<T>) -> Self
Sets or clears the value of weekly_backup_limit.
§Example
let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);Sourcepub fn set_monthly_backup_limit<T>(self, v: T) -> Self
pub fn set_monthly_backup_limit<T>(self, v: T) -> Self
Sets the value of monthly_backup_limit.
§Example
let x = BackupPolicy::new().set_monthly_backup_limit(42);Sourcepub fn set_or_clear_monthly_backup_limit<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_monthly_backup_limit<T>(self, v: Option<T>) -> Self
Sets or clears the value of monthly_backup_limit.
§Example
let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = BackupPolicy::new().set_or_clear_description(Some("example"));
let x = BackupPolicy::new().set_or_clear_description(None::<String>);Sourcepub fn set_enabled<T>(self, v: T) -> Self
pub fn set_enabled<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_enabled<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_enabled<T>(self, v: Option<T>) -> Self
Sourcepub fn set_assigned_volume_count<T>(self, v: T) -> Self
pub fn set_assigned_volume_count<T>(self, v: T) -> Self
Sets the value of assigned_volume_count.
§Example
let x = BackupPolicy::new().set_assigned_volume_count(42);Sourcepub fn set_or_clear_assigned_volume_count<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_assigned_volume_count<T>(self, v: Option<T>) -> Self
Sets or clears the value of assigned_volume_count.
§Example
let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for BackupPolicy
impl Clone for BackupPolicy
Source§fn clone(&self) -> BackupPolicy
fn clone(&self) -> BackupPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more