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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents a resource that is under DDoS protection.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Protection {
/// <p>The unique identifier (ID) of the protection.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The name of the protection. For example, <code>My CloudFront distributions</code>.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected.</p>
pub resource_arn: ::std::option::Option<::std::string::String>,
/// <p>The unique identifier (ID) for the Route 53 health check that's associated with the protection.</p>
pub health_check_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The ARN (Amazon Resource Name) of the protection.</p>
pub protection_arn: ::std::option::Option<::std::string::String>,
/// <p>The automatic application layer DDoS mitigation settings for the protection. This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.</p>
pub application_layer_automatic_response_configuration: ::std::option::Option<crate::types::ApplicationLayerAutomaticResponseConfiguration>,
}
impl Protection {
/// <p>The unique identifier (ID) of the protection.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The name of the protection. For example, <code>My CloudFront distributions</code>.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected.</p>
pub fn resource_arn(&self) -> ::std::option::Option<&str> {
self.resource_arn.as_deref()
}
/// <p>The unique identifier (ID) for the Route 53 health check that's associated with the protection.</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 `.health_check_ids.is_none()`.
pub fn health_check_ids(&self) -> &[::std::string::String] {
self.health_check_ids.as_deref().unwrap_or_default()
}
/// <p>The ARN (Amazon Resource Name) of the protection.</p>
pub fn protection_arn(&self) -> ::std::option::Option<&str> {
self.protection_arn.as_deref()
}
/// <p>The automatic application layer DDoS mitigation settings for the protection. This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.</p>
pub fn application_layer_automatic_response_configuration(
&self,
) -> ::std::option::Option<&crate::types::ApplicationLayerAutomaticResponseConfiguration> {
self.application_layer_automatic_response_configuration.as_ref()
}
}
impl Protection {
/// Creates a new builder-style object to manufacture [`Protection`](crate::types::Protection).
pub fn builder() -> crate::types::builders::ProtectionBuilder {
crate::types::builders::ProtectionBuilder::default()
}
}
/// A builder for [`Protection`](crate::types::Protection).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ProtectionBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) health_check_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) protection_arn: ::std::option::Option<::std::string::String>,
pub(crate) application_layer_automatic_response_configuration:
::std::option::Option<crate::types::ApplicationLayerAutomaticResponseConfiguration>,
}
impl ProtectionBuilder {
/// <p>The unique identifier (ID) of the protection.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique identifier (ID) of the protection.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The unique identifier (ID) of the protection.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The name of the protection. For example, <code>My CloudFront distributions</code>.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the protection. For example, <code>My CloudFront distributions</code>.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the protection. For example, <code>My CloudFront distributions</code>.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected.</p>
pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected.</p>
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_arn = input;
self
}
/// <p>The ARN (Amazon Resource Name) of the Amazon Web Services resource that is protected.</p>
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_arn
}
/// Appends an item to `health_check_ids`.
///
/// To override the contents of this collection use [`set_health_check_ids`](Self::set_health_check_ids).
///
/// <p>The unique identifier (ID) for the Route 53 health check that's associated with the protection.</p>
pub fn health_check_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.health_check_ids.unwrap_or_default();
v.push(input.into());
self.health_check_ids = ::std::option::Option::Some(v);
self
}
/// <p>The unique identifier (ID) for the Route 53 health check that's associated with the protection.</p>
pub fn set_health_check_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.health_check_ids = input;
self
}
/// <p>The unique identifier (ID) for the Route 53 health check that's associated with the protection.</p>
pub fn get_health_check_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.health_check_ids
}
/// <p>The ARN (Amazon Resource Name) of the protection.</p>
pub fn protection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.protection_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN (Amazon Resource Name) of the protection.</p>
pub fn set_protection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.protection_arn = input;
self
}
/// <p>The ARN (Amazon Resource Name) of the protection.</p>
pub fn get_protection_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.protection_arn
}
/// <p>The automatic application layer DDoS mitigation settings for the protection. This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.</p>
pub fn application_layer_automatic_response_configuration(mut self, input: crate::types::ApplicationLayerAutomaticResponseConfiguration) -> Self {
self.application_layer_automatic_response_configuration = ::std::option::Option::Some(input);
self
}
/// <p>The automatic application layer DDoS mitigation settings for the protection. This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.</p>
pub fn set_application_layer_automatic_response_configuration(
mut self,
input: ::std::option::Option<crate::types::ApplicationLayerAutomaticResponseConfiguration>,
) -> Self {
self.application_layer_automatic_response_configuration = input;
self
}
/// <p>The automatic application layer DDoS mitigation settings for the protection. This configuration determines whether Shield Advanced automatically manages rules in the web ACL in order to respond to application layer events that Shield Advanced determines to be DDoS attacks.</p>
pub fn get_application_layer_automatic_response_configuration(
&self,
) -> &::std::option::Option<crate::types::ApplicationLayerAutomaticResponseConfiguration> {
&self.application_layer_automatic_response_configuration
}
/// Consumes the builder and constructs a [`Protection`](crate::types::Protection).
pub fn build(self) -> crate::types::Protection {
crate::types::Protection {
id: self.id,
name: self.name,
resource_arn: self.resource_arn,
health_check_ids: self.health_check_ids,
protection_arn: self.protection_arn,
application_layer_automatic_response_configuration: self.application_layer_automatic_response_configuration,
}
}
}