1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// SnapshotPlan : Details of the active snapshot plan. Not available if the `status` is `initializing`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SnapshotPlan {
/// Day of the month when the Snapshot Plan is executed. Null means every day.
#[serde(rename = "day_of_month", deserialize_with = "Option::deserialize")]
pub day_of_month: Option<i32>,
/// Day of the week when the Snapshot Plan is executed. Starts at 1 for Monday til 7 for Sunday. Null means every day.
#[serde(rename = "day_of_week", deserialize_with = "Option::deserialize")]
pub day_of_week: Option<i32>,
/// Hour when the Snapshot Plan is executed (UTC).
#[serde(rename = "hour")]
pub hour: i32,
/// Maximum amount of Snapshots that will be created by this Snapshot Plan. Older Snapshots will be deleted.
#[serde(rename = "max_snapshots")]
pub max_snapshots: i32,
/// Minute when the Snapshot Plan is executed (UTC).
#[serde(rename = "minute")]
pub minute: i32,
}
impl SnapshotPlan {
/// Details of the active snapshot plan. Not available if the `status` is `initializing`.
pub fn new(
day_of_month: Option<i32>,
day_of_week: Option<i32>,
hour: i32,
max_snapshots: i32,
minute: i32,
) -> SnapshotPlan {
SnapshotPlan {
day_of_month,
day_of_week,
hour,
max_snapshots,
minute,
}
}
}