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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A resource related to a finding.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Resource {
/// <p>The type of the resource that details are provided for. If possible, set <code>Type</code> to one of the supported resource types. For example, if the resource is an EC2 instance, then set <code>Type</code> to <code>AwsEc2Instance</code>.</p>
/// <p>If the resource does not match any of the provided types, then set <code>Type</code> to <code>Other</code>.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 256.</p>
pub r#type: ::std::option::Option<::std::string::String>,
/// <p>The canonical identifier for the given resource type.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The canonical Amazon Web Services partition name that the Region is assigned to.</p>
pub partition: ::std::option::Option<crate::types::Partition>,
/// <p>The canonical Amazon Web Services external Region name where this resource is located.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 16.</p>
pub region: ::std::option::Option<::std::string::String>,
/// <p>Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,</p>
pub resource_role: ::std::option::Option<::std::string::String>,
/// <p>A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions">Amazon Web Services tag naming limits and requirements</a>.</p>
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>Contains information about sensitive data that was detected on the resource.</p>
pub data_classification: ::std::option::Option<crate::types::DataClassificationDetails>,
/// <p>Additional details about the resource related to a finding.</p>
pub details: ::std::option::Option<crate::types::ResourceDetails>,
/// <p>The name of the application that is related to a finding.</p>
pub application_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the application that is related to a finding.</p>
pub application_arn: ::std::option::Option<::std::string::String>,
}
impl Resource {
/// <p>The type of the resource that details are provided for. If possible, set <code>Type</code> to one of the supported resource types. For example, if the resource is an EC2 instance, then set <code>Type</code> to <code>AwsEc2Instance</code>.</p>
/// <p>If the resource does not match any of the provided types, then set <code>Type</code> to <code>Other</code>.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 256.</p>
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
/// <p>The canonical identifier for the given resource type.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The canonical Amazon Web Services partition name that the Region is assigned to.</p>
pub fn partition(&self) -> ::std::option::Option<&crate::types::Partition> {
self.partition.as_ref()
}
/// <p>The canonical Amazon Web Services external Region name where this resource is located.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 16.</p>
pub fn region(&self) -> ::std::option::Option<&str> {
self.region.as_deref()
}
/// <p>Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,</p>
pub fn resource_role(&self) -> ::std::option::Option<&str> {
self.resource_role.as_deref()
}
/// <p>A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions">Amazon Web Services tag naming limits and requirements</a>.</p>
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
/// <p>Contains information about sensitive data that was detected on the resource.</p>
pub fn data_classification(&self) -> ::std::option::Option<&crate::types::DataClassificationDetails> {
self.data_classification.as_ref()
}
/// <p>Additional details about the resource related to a finding.</p>
pub fn details(&self) -> ::std::option::Option<&crate::types::ResourceDetails> {
self.details.as_ref()
}
/// <p>The name of the application that is related to a finding.</p>
pub fn application_name(&self) -> ::std::option::Option<&str> {
self.application_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the application that is related to a finding.</p>
pub fn application_arn(&self) -> ::std::option::Option<&str> {
self.application_arn.as_deref()
}
}
impl Resource {
/// Creates a new builder-style object to manufacture [`Resource`](crate::types::Resource).
pub fn builder() -> crate::types::builders::ResourceBuilder {
crate::types::builders::ResourceBuilder::default()
}
}
/// A builder for [`Resource`](crate::types::Resource).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ResourceBuilder {
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) partition: ::std::option::Option<crate::types::Partition>,
pub(crate) region: ::std::option::Option<::std::string::String>,
pub(crate) resource_role: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) data_classification: ::std::option::Option<crate::types::DataClassificationDetails>,
pub(crate) details: ::std::option::Option<crate::types::ResourceDetails>,
pub(crate) application_name: ::std::option::Option<::std::string::String>,
pub(crate) application_arn: ::std::option::Option<::std::string::String>,
}
impl ResourceBuilder {
/// <p>The type of the resource that details are provided for. If possible, set <code>Type</code> to one of the supported resource types. For example, if the resource is an EC2 instance, then set <code>Type</code> to <code>AwsEc2Instance</code>.</p>
/// <p>If the resource does not match any of the provided types, then set <code>Type</code> to <code>Other</code>.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 256.</p>
/// This field is required.
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of the resource that details are provided for. If possible, set <code>Type</code> to one of the supported resource types. For example, if the resource is an EC2 instance, then set <code>Type</code> to <code>AwsEc2Instance</code>.</p>
/// <p>If the resource does not match any of the provided types, then set <code>Type</code> to <code>Other</code>.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 256.</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The type of the resource that details are provided for. If possible, set <code>Type</code> to one of the supported resource types. For example, if the resource is an EC2 instance, then set <code>Type</code> to <code>AwsEc2Instance</code>.</p>
/// <p>If the resource does not match any of the provided types, then set <code>Type</code> to <code>Other</code>.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 256.</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// <p>The canonical identifier for the given resource type.</p>
/// This field is required.
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 canonical identifier for the given resource type.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The canonical identifier for the given resource type.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The canonical Amazon Web Services partition name that the Region is assigned to.</p>
pub fn partition(mut self, input: crate::types::Partition) -> Self {
self.partition = ::std::option::Option::Some(input);
self
}
/// <p>The canonical Amazon Web Services partition name that the Region is assigned to.</p>
pub fn set_partition(mut self, input: ::std::option::Option<crate::types::Partition>) -> Self {
self.partition = input;
self
}
/// <p>The canonical Amazon Web Services partition name that the Region is assigned to.</p>
pub fn get_partition(&self) -> &::std::option::Option<crate::types::Partition> {
&self.partition
}
/// <p>The canonical Amazon Web Services external Region name where this resource is located.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 16.</p>
pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.region = ::std::option::Option::Some(input.into());
self
}
/// <p>The canonical Amazon Web Services external Region name where this resource is located.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 16.</p>
pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.region = input;
self
}
/// <p>The canonical Amazon Web Services external Region name where this resource is located.</p>
/// <p>Length Constraints: Minimum length of 1. Maximum length of 16.</p>
pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
&self.region
}
/// <p>Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,</p>
pub fn resource_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_role = ::std::option::Option::Some(input.into());
self
}
/// <p>Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,</p>
pub fn set_resource_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_role = input;
self
}
/// <p>Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,</p>
pub fn get_resource_role(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_role
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions">Amazon Web Services tag naming limits and requirements</a>.</p>
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
/// <p>A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions">Amazon Web Services tag naming limits and requirements</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
/// <p>A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions">Amazon Web Services tag naming limits and requirements</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// <p>Contains information about sensitive data that was detected on the resource.</p>
pub fn data_classification(mut self, input: crate::types::DataClassificationDetails) -> Self {
self.data_classification = ::std::option::Option::Some(input);
self
}
/// <p>Contains information about sensitive data that was detected on the resource.</p>
pub fn set_data_classification(mut self, input: ::std::option::Option<crate::types::DataClassificationDetails>) -> Self {
self.data_classification = input;
self
}
/// <p>Contains information about sensitive data that was detected on the resource.</p>
pub fn get_data_classification(&self) -> &::std::option::Option<crate::types::DataClassificationDetails> {
&self.data_classification
}
/// <p>Additional details about the resource related to a finding.</p>
pub fn details(mut self, input: crate::types::ResourceDetails) -> Self {
self.details = ::std::option::Option::Some(input);
self
}
/// <p>Additional details about the resource related to a finding.</p>
pub fn set_details(mut self, input: ::std::option::Option<crate::types::ResourceDetails>) -> Self {
self.details = input;
self
}
/// <p>Additional details about the resource related to a finding.</p>
pub fn get_details(&self) -> &::std::option::Option<crate::types::ResourceDetails> {
&self.details
}
/// <p>The name of the application that is related to a finding.</p>
pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.application_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the application that is related to a finding.</p>
pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.application_name = input;
self
}
/// <p>The name of the application that is related to a finding.</p>
pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
&self.application_name
}
/// <p>The Amazon Resource Name (ARN) of the application that is related to a finding.</p>
pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.application_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the application that is related to a finding.</p>
pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.application_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the application that is related to a finding.</p>
pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.application_arn
}
/// Consumes the builder and constructs a [`Resource`](crate::types::Resource).
pub fn build(self) -> crate::types::Resource {
crate::types::Resource {
r#type: self.r#type,
id: self.id,
partition: self.partition,
region: self.region,
resource_role: self.resource_role,
tags: self.tags,
data_classification: self.data_classification,
details: self.details,
application_name: self.application_name,
application_arn: self.application_arn,
}
}
}