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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about the Shield Advanced subscription for an account.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subscription {
/// <p>The start time of the subscription, in Unix time in seconds.</p>
pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The date and time your subscription will end.</p>
pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
pub time_commitment_in_seconds: i64,
/// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
/// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
pub auto_renew: ::std::option::Option<crate::types::AutoRenew>,
/// <p>Specifies how many protections of a given type you can create.</p>
pub limits: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>,
/// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
/// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
/// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
pub proactive_engagement_status: ::std::option::Option<crate::types::ProactiveEngagementStatus>,
/// <p>Limits settings for your subscription.</p>
pub subscription_limits: ::std::option::Option<crate::types::SubscriptionLimits>,
/// <p>The ARN (Amazon Resource Name) of the subscription.</p>
pub subscription_arn: ::std::option::Option<::std::string::String>,
}
impl Subscription {
/// <p>The start time of the subscription, in Unix time in seconds.</p>
pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The date and time your subscription will end.</p>
pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
pub fn time_commitment_in_seconds(&self) -> i64 {
self.time_commitment_in_seconds
}
/// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
/// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
pub fn auto_renew(&self) -> ::std::option::Option<&crate::types::AutoRenew> {
self.auto_renew.as_ref()
}
/// <p>Specifies how many protections of a given type you can create.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.limits.is_none()`.
pub fn limits(&self) -> &[crate::types::Limit] {
self.limits.as_deref().unwrap_or_default()
}
/// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
/// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
/// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
pub fn proactive_engagement_status(&self) -> ::std::option::Option<&crate::types::ProactiveEngagementStatus> {
self.proactive_engagement_status.as_ref()
}
/// <p>Limits settings for your subscription.</p>
pub fn subscription_limits(&self) -> ::std::option::Option<&crate::types::SubscriptionLimits> {
self.subscription_limits.as_ref()
}
/// <p>The ARN (Amazon Resource Name) of the subscription.</p>
pub fn subscription_arn(&self) -> ::std::option::Option<&str> {
self.subscription_arn.as_deref()
}
}
impl Subscription {
/// Creates a new builder-style object to manufacture [`Subscription`](crate::types::Subscription).
pub fn builder() -> crate::types::builders::SubscriptionBuilder {
crate::types::builders::SubscriptionBuilder::default()
}
}
/// A builder for [`Subscription`](crate::types::Subscription).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubscriptionBuilder {
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) time_commitment_in_seconds: ::std::option::Option<i64>,
pub(crate) auto_renew: ::std::option::Option<crate::types::AutoRenew>,
pub(crate) limits: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>,
pub(crate) proactive_engagement_status: ::std::option::Option<crate::types::ProactiveEngagementStatus>,
pub(crate) subscription_limits: ::std::option::Option<crate::types::SubscriptionLimits>,
pub(crate) subscription_arn: ::std::option::Option<::std::string::String>,
}
impl SubscriptionBuilder {
/// <p>The start time of the subscription, in Unix time in seconds.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
/// <p>The start time of the subscription, in Unix time in seconds.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
/// <p>The start time of the subscription, in Unix time in seconds.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
/// <p>The date and time your subscription will end.</p>
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_time = ::std::option::Option::Some(input);
self
}
/// <p>The date and time your subscription will end.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_time = input;
self
}
/// <p>The date and time your subscription will end.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_time
}
/// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
pub fn time_commitment_in_seconds(mut self, input: i64) -> Self {
self.time_commitment_in_seconds = ::std::option::Option::Some(input);
self
}
/// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
pub fn set_time_commitment_in_seconds(mut self, input: ::std::option::Option<i64>) -> Self {
self.time_commitment_in_seconds = input;
self
}
/// <p>The length, in seconds, of the Shield Advanced subscription for the account.</p>
pub fn get_time_commitment_in_seconds(&self) -> &::std::option::Option<i64> {
&self.time_commitment_in_seconds
}
/// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
/// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
pub fn auto_renew(mut self, input: crate::types::AutoRenew) -> Self {
self.auto_renew = ::std::option::Option::Some(input);
self
}
/// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
/// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
pub fn set_auto_renew(mut self, input: ::std::option::Option<crate::types::AutoRenew>) -> Self {
self.auto_renew = input;
self
}
/// <p>If <code>ENABLED</code>, the subscription will be automatically renewed at the end of the existing subscription period.</p>
/// <p>When you initally create a subscription, <code>AutoRenew</code> is set to <code>ENABLED</code>. You can change this by submitting an <code>UpdateSubscription</code> request. If the <code>UpdateSubscription</code> request does not included a value for <code>AutoRenew</code>, the existing value for <code>AutoRenew</code> remains unchanged.</p>
pub fn get_auto_renew(&self) -> &::std::option::Option<crate::types::AutoRenew> {
&self.auto_renew
}
/// Appends an item to `limits`.
///
/// To override the contents of this collection use [`set_limits`](Self::set_limits).
///
/// <p>Specifies how many protections of a given type you can create.</p>
pub fn limits(mut self, input: crate::types::Limit) -> Self {
let mut v = self.limits.unwrap_or_default();
v.push(input);
self.limits = ::std::option::Option::Some(v);
self
}
/// <p>Specifies how many protections of a given type you can create.</p>
pub fn set_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Limit>>) -> Self {
self.limits = input;
self
}
/// <p>Specifies how many protections of a given type you can create.</p>
pub fn get_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Limit>> {
&self.limits
}
/// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
/// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
/// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
pub fn proactive_engagement_status(mut self, input: crate::types::ProactiveEngagementStatus) -> Self {
self.proactive_engagement_status = ::std::option::Option::Some(input);
self
}
/// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
/// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
/// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
pub fn set_proactive_engagement_status(mut self, input: ::std::option::Option<crate::types::ProactiveEngagementStatus>) -> Self {
self.proactive_engagement_status = input;
self
}
/// <p>If <code>ENABLED</code>, the Shield Response Team (SRT) will use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.</p>
/// <p>If <code>PENDING</code>, you have requested proactive engagement and the request is pending. The status changes to <code>ENABLED</code> when your request is fully processed.</p>
/// <p>If <code>DISABLED</code>, the SRT will not proactively notify contacts about escalations or to initiate proactive customer support.</p>
pub fn get_proactive_engagement_status(&self) -> &::std::option::Option<crate::types::ProactiveEngagementStatus> {
&self.proactive_engagement_status
}
/// <p>Limits settings for your subscription.</p>
/// This field is required.
pub fn subscription_limits(mut self, input: crate::types::SubscriptionLimits) -> Self {
self.subscription_limits = ::std::option::Option::Some(input);
self
}
/// <p>Limits settings for your subscription.</p>
pub fn set_subscription_limits(mut self, input: ::std::option::Option<crate::types::SubscriptionLimits>) -> Self {
self.subscription_limits = input;
self
}
/// <p>Limits settings for your subscription.</p>
pub fn get_subscription_limits(&self) -> &::std::option::Option<crate::types::SubscriptionLimits> {
&self.subscription_limits
}
/// <p>The ARN (Amazon Resource Name) of the subscription.</p>
pub fn subscription_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subscription_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN (Amazon Resource Name) of the subscription.</p>
pub fn set_subscription_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subscription_arn = input;
self
}
/// <p>The ARN (Amazon Resource Name) of the subscription.</p>
pub fn get_subscription_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.subscription_arn
}
/// Consumes the builder and constructs a [`Subscription`](crate::types::Subscription).
pub fn build(self) -> crate::types::Subscription {
crate::types::Subscription {
start_time: self.start_time,
end_time: self.end_time,
time_commitment_in_seconds: self.time_commitment_in_seconds.unwrap_or_default(),
auto_renew: self.auto_renew,
limits: self.limits,
proactive_engagement_status: self.proactive_engagement_status,
subscription_limits: self.subscription_limits,
subscription_arn: self.subscription_arn,
}
}
}