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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetFindingV2Output {
/// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
pub analyzed_at: ::aws_smithy_types::DateTime,
/// <p>The time at which the finding was created.</p>
pub created_at: ::aws_smithy_types::DateTime,
/// <p>An error.</p>
pub error: ::std::option::Option<::std::string::String>,
/// <p>The ID of the finding to retrieve.</p>
pub id: ::std::string::String,
/// <p>A token used for pagination of results returned.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>The resource that generated the finding.</p>
pub resource: ::std::option::Option<::std::string::String>,
/// <p>The type of the resource identified in the finding.</p>
pub resource_type: crate::types::ResourceType,
/// <p>Tye Amazon Web Services account ID that owns the resource.</p>
pub resource_owner_account: ::std::string::String,
/// <p>The status of the finding.</p>
pub status: crate::types::FindingStatus,
/// <p>The time at which the finding was updated.</p>
pub updated_at: ::aws_smithy_types::DateTime,
/// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
pub finding_details: ::std::vec::Vec<crate::types::FindingDetails>,
/// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
pub finding_type: ::std::option::Option<crate::types::FindingType>,
_request_id: Option<String>,
}
impl GetFindingV2Output {
/// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
pub fn analyzed_at(&self) -> &::aws_smithy_types::DateTime {
&self.analyzed_at
}
/// <p>The time at which the finding was created.</p>
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
/// <p>An error.</p>
pub fn error(&self) -> ::std::option::Option<&str> {
self.error.as_deref()
}
/// <p>The ID of the finding to retrieve.</p>
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
/// <p>A token used for pagination of results returned.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>The resource that generated the finding.</p>
pub fn resource(&self) -> ::std::option::Option<&str> {
self.resource.as_deref()
}
/// <p>The type of the resource identified in the finding.</p>
pub fn resource_type(&self) -> &crate::types::ResourceType {
&self.resource_type
}
/// <p>Tye Amazon Web Services account ID that owns the resource.</p>
pub fn resource_owner_account(&self) -> &str {
use std::ops::Deref;
self.resource_owner_account.deref()
}
/// <p>The status of the finding.</p>
pub fn status(&self) -> &crate::types::FindingStatus {
&self.status
}
/// <p>The time at which the finding was updated.</p>
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
/// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
pub fn finding_details(&self) -> &[crate::types::FindingDetails] {
use std::ops::Deref;
self.finding_details.deref()
}
/// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
pub fn finding_type(&self) -> ::std::option::Option<&crate::types::FindingType> {
self.finding_type.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetFindingV2Output {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetFindingV2Output {
/// Creates a new builder-style object to manufacture [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
pub fn builder() -> crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder {
crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::default()
}
}
/// A builder for [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFindingV2OutputBuilder {
pub(crate) analyzed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) error: ::std::option::Option<::std::string::String>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) resource: ::std::option::Option<::std::string::String>,
pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
pub(crate) resource_owner_account: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) finding_details: ::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>>,
pub(crate) finding_type: ::std::option::Option<crate::types::FindingType>,
_request_id: Option<String>,
}
impl GetFindingV2OutputBuilder {
/// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
/// This field is required.
pub fn analyzed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.analyzed_at = ::std::option::Option::Some(input);
self
}
/// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
pub fn set_analyzed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.analyzed_at = input;
self
}
/// <p>The time at which the resource-based policy or IAM entity that generated the finding was analyzed.</p>
pub fn get_analyzed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.analyzed_at
}
/// <p>The time at which the finding was created.</p>
/// This field is required.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// <p>The time at which the finding was created.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// <p>The time at which the finding was created.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// <p>An error.</p>
pub fn error(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error = ::std::option::Option::Some(input.into());
self
}
/// <p>An error.</p>
pub fn set_error(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error = input;
self
}
/// <p>An error.</p>
pub fn get_error(&self) -> &::std::option::Option<::std::string::String> {
&self.error
}
/// <p>The ID of the finding to retrieve.</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 ID of the finding to retrieve.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The ID of the finding to retrieve.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>A token used for pagination of results returned.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A token used for pagination of results returned.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>A token used for pagination of results returned.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// <p>The resource that generated the finding.</p>
pub fn resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource = ::std::option::Option::Some(input.into());
self
}
/// <p>The resource that generated the finding.</p>
pub fn set_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource = input;
self
}
/// <p>The resource that generated the finding.</p>
pub fn get_resource(&self) -> &::std::option::Option<::std::string::String> {
&self.resource
}
/// <p>The type of the resource identified in the finding.</p>
/// This field is required.
pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
self.resource_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the resource identified in the finding.</p>
pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
self.resource_type = input;
self
}
/// <p>The type of the resource identified in the finding.</p>
pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
&self.resource_type
}
/// <p>Tye Amazon Web Services account ID that owns the resource.</p>
/// This field is required.
pub fn resource_owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_owner_account = ::std::option::Option::Some(input.into());
self
}
/// <p>Tye Amazon Web Services account ID that owns the resource.</p>
pub fn set_resource_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_owner_account = input;
self
}
/// <p>Tye Amazon Web Services account ID that owns the resource.</p>
pub fn get_resource_owner_account(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_owner_account
}
/// <p>The status of the finding.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The status of the finding.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
self.status = input;
self
}
/// <p>The status of the finding.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
&self.status
}
/// <p>The time at which the finding was updated.</p>
/// This field is required.
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>The time at which the finding was updated.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The time at which the finding was updated.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// Appends an item to `finding_details`.
///
/// To override the contents of this collection use [`set_finding_details`](Self::set_finding_details).
///
/// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
pub fn finding_details(mut self, input: crate::types::FindingDetails) -> Self {
let mut v = self.finding_details.unwrap_or_default();
v.push(input);
self.finding_details = ::std::option::Option::Some(v);
self
}
/// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
pub fn set_finding_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>>) -> Self {
self.finding_details = input;
self
}
/// <p>A localized message that explains the finding and provides guidance on how to address it.</p>
pub fn get_finding_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FindingDetails>> {
&self.finding_details
}
/// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
pub fn finding_type(mut self, input: crate::types::FindingType) -> Self {
self.finding_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
pub fn set_finding_type(mut self, input: ::std::option::Option<crate::types::FindingType>) -> Self {
self.finding_type = input;
self
}
/// <p>The type of the finding. For external access analyzers, the type is <code>ExternalAccess</code>. For unused access analyzers, the type can be <code>UnusedIAMRole</code>, <code>UnusedIAMUserAccessKey</code>, <code>UnusedIAMUserPassword</code>, or <code>UnusedPermission</code>. For internal access analyzers, the type is <code>InternalAccess</code>.</p>
pub fn get_finding_type(&self) -> &::std::option::Option<crate::types::FindingType> {
&self.finding_type
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetFindingV2Output`](crate::operation::get_finding_v2::GetFindingV2Output).
/// This method will fail if any of the following fields are not set:
/// - [`analyzed_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::analyzed_at)
/// - [`created_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::created_at)
/// - [`id`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::id)
/// - [`resource_type`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::resource_type)
/// - [`resource_owner_account`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::resource_owner_account)
/// - [`status`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::status)
/// - [`updated_at`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::updated_at)
/// - [`finding_details`](crate::operation::get_finding_v2::builders::GetFindingV2OutputBuilder::finding_details)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_finding_v2::GetFindingV2Output, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_finding_v2::GetFindingV2Output {
analyzed_at: self.analyzed_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"analyzed_at",
"analyzed_at was not specified but it is required when building GetFindingV2Output",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building GetFindingV2Output",
)
})?,
error: self.error,
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"id",
"id was not specified but it is required when building GetFindingV2Output",
)
})?,
next_token: self.next_token,
resource: self.resource,
resource_type: self.resource_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"resource_type",
"resource_type was not specified but it is required when building GetFindingV2Output",
)
})?,
resource_owner_account: self.resource_owner_account.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"resource_owner_account",
"resource_owner_account was not specified but it is required when building GetFindingV2Output",
)
})?,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building GetFindingV2Output",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building GetFindingV2Output",
)
})?,
finding_details: self.finding_details.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"finding_details",
"finding_details was not specified but it is required when building GetFindingV2Output",
)
})?,
finding_type: self.finding_type,
_request_id: self._request_id,
})
}
}