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
// 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 PutAuditEventsOutput {
/// <p>Lists events in the provided event payload that were successfully ingested into CloudTrail.</p>
pub successful: ::std::vec::Vec<crate::types::AuditEventResultEntry>,
/// <p>Lists events in the provided event payload that could not be ingested into CloudTrail, and includes the error code and error message returned for events that could not be ingested.</p>
pub failed: ::std::vec::Vec<crate::types::ResultErrorEntry>,
_request_id: Option<String>,
}
impl PutAuditEventsOutput {
/// <p>Lists events in the provided event payload that were successfully ingested into CloudTrail.</p>
pub fn successful(&self) -> &[crate::types::AuditEventResultEntry] {
use std::ops::Deref;
self.successful.deref()
}
/// <p>Lists events in the provided event payload that could not be ingested into CloudTrail, and includes the error code and error message returned for events that could not be ingested.</p>
pub fn failed(&self) -> &[crate::types::ResultErrorEntry] {
use std::ops::Deref;
self.failed.deref()
}
}
impl ::aws_types::request_id::RequestId for PutAuditEventsOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl PutAuditEventsOutput {
/// Creates a new builder-style object to manufacture [`PutAuditEventsOutput`](crate::operation::put_audit_events::PutAuditEventsOutput).
pub fn builder() -> crate::operation::put_audit_events::builders::PutAuditEventsOutputBuilder {
crate::operation::put_audit_events::builders::PutAuditEventsOutputBuilder::default()
}
}
/// A builder for [`PutAuditEventsOutput`](crate::operation::put_audit_events::PutAuditEventsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutAuditEventsOutputBuilder {
pub(crate) successful: ::std::option::Option<::std::vec::Vec<crate::types::AuditEventResultEntry>>,
pub(crate) failed: ::std::option::Option<::std::vec::Vec<crate::types::ResultErrorEntry>>,
_request_id: Option<String>,
}
impl PutAuditEventsOutputBuilder {
/// Appends an item to `successful`.
///
/// To override the contents of this collection use [`set_successful`](Self::set_successful).
///
/// <p>Lists events in the provided event payload that were successfully ingested into CloudTrail.</p>
pub fn successful(mut self, input: crate::types::AuditEventResultEntry) -> Self {
let mut v = self.successful.unwrap_or_default();
v.push(input);
self.successful = ::std::option::Option::Some(v);
self
}
/// <p>Lists events in the provided event payload that were successfully ingested into CloudTrail.</p>
pub fn set_successful(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AuditEventResultEntry>>) -> Self {
self.successful = input;
self
}
/// <p>Lists events in the provided event payload that were successfully ingested into CloudTrail.</p>
pub fn get_successful(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AuditEventResultEntry>> {
&self.successful
}
/// Appends an item to `failed`.
///
/// To override the contents of this collection use [`set_failed`](Self::set_failed).
///
/// <p>Lists events in the provided event payload that could not be ingested into CloudTrail, and includes the error code and error message returned for events that could not be ingested.</p>
pub fn failed(mut self, input: crate::types::ResultErrorEntry) -> Self {
let mut v = self.failed.unwrap_or_default();
v.push(input);
self.failed = ::std::option::Option::Some(v);
self
}
/// <p>Lists events in the provided event payload that could not be ingested into CloudTrail, and includes the error code and error message returned for events that could not be ingested.</p>
pub fn set_failed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResultErrorEntry>>) -> Self {
self.failed = input;
self
}
/// <p>Lists events in the provided event payload that could not be ingested into CloudTrail, and includes the error code and error message returned for events that could not be ingested.</p>
pub fn get_failed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResultErrorEntry>> {
&self.failed
}
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 [`PutAuditEventsOutput`](crate::operation::put_audit_events::PutAuditEventsOutput).
/// This method will fail if any of the following fields are not set:
/// - [`successful`](crate::operation::put_audit_events::builders::PutAuditEventsOutputBuilder::successful)
/// - [`failed`](crate::operation::put_audit_events::builders::PutAuditEventsOutputBuilder::failed)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_audit_events::PutAuditEventsOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_audit_events::PutAuditEventsOutput {
successful: self.successful.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"successful",
"successful was not specified but it is required when building PutAuditEventsOutput",
)
})?,
failed: self.failed.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"failed",
"failed was not specified but it is required when building PutAuditEventsOutput",
)
})?,
_request_id: self._request_id,
})
}
}