Skip to main content

winterbaume_shield/
types.rs

1use chrono::{DateTime, Utc};
2
3/// A Shield Advanced subscription.
4#[derive(Debug, Clone)]
5pub struct Subscription {
6    pub start_time: DateTime<Utc>,
7    pub end_time: Option<DateTime<Utc>>,
8    pub time_commitment_in_seconds: i64,
9    pub auto_renew: AutoRenew,
10    pub subscription_arn: String,
11}
12
13/// Auto-renew setting for a subscription.
14#[derive(Debug, Clone, PartialEq)]
15pub enum AutoRenew {
16    Enabled,
17    Disabled,
18}
19
20impl AutoRenew {
21    pub fn as_str(&self) -> &str {
22        match self {
23            AutoRenew::Enabled => "ENABLED",
24            AutoRenew::Disabled => "DISABLED",
25        }
26    }
27}
28
29/// A resource protection.
30#[derive(Debug, Clone)]
31pub struct Protection {
32    pub id: String,
33    pub name: String,
34    pub resource_arn: String,
35    pub protection_arn: String,
36    pub health_check_ids: Vec<String>,
37    pub tags: Vec<Tag>,
38}
39
40/// A key-value tag.
41#[derive(Debug, Clone)]
42pub struct Tag {
43    pub key: String,
44    pub value: String,
45}