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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Identifies an Amazon Web Services resource and indicates whether it complies with the Config rule that it was evaluated against.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Evaluation {
/// <p>The type of Amazon Web Services resource that was evaluated.</p>
pub compliance_resource_type: ::std::string::String,
/// <p>The ID of the Amazon Web Services resource that was evaluated.</p>
pub compliance_resource_id: ::std::string::String,
/// <p>Indicates whether the Amazon Web Services resource complies with the Config rule that it was evaluated against.</p>
/// <p>For the <code>Evaluation</code> data type, Config supports only the <code>COMPLIANT</code>, <code>NON_COMPLIANT</code>, and <code>NOT_APPLICABLE</code> values. Config does not support the <code>INSUFFICIENT_DATA</code> value for this data type.</p>
/// <p>Similarly, Config does not accept <code>INSUFFICIENT_DATA</code> as the value for <code>ComplianceType</code> from a <code>PutEvaluations</code> request. For example, an Lambda function for a custom Config rule cannot pass an <code>INSUFFICIENT_DATA</code> value to Config.</p>
pub compliance_type: crate::types::ComplianceType,
/// <p>Supplementary information about how the evaluation determined the compliance.</p>
pub annotation: ::std::option::Option<::std::string::String>,
/// <p>The time of the event in Config that triggered the evaluation. For event-based evaluations, the time indicates when Config created the configuration item that triggered the evaluation. For periodic evaluations, the time indicates when Config triggered the evaluation at the frequency that you specified (for example, every 24 hours).</p>
pub ordering_timestamp: ::aws_smithy_types::DateTime,
}
impl Evaluation {
/// <p>The type of Amazon Web Services resource that was evaluated.</p>
pub fn compliance_resource_type(&self) -> &str {
use std::ops::Deref;
self.compliance_resource_type.deref()
}
/// <p>The ID of the Amazon Web Services resource that was evaluated.</p>
pub fn compliance_resource_id(&self) -> &str {
use std::ops::Deref;
self.compliance_resource_id.deref()
}
/// <p>Indicates whether the Amazon Web Services resource complies with the Config rule that it was evaluated against.</p>
/// <p>For the <code>Evaluation</code> data type, Config supports only the <code>COMPLIANT</code>, <code>NON_COMPLIANT</code>, and <code>NOT_APPLICABLE</code> values. Config does not support the <code>INSUFFICIENT_DATA</code> value for this data type.</p>
/// <p>Similarly, Config does not accept <code>INSUFFICIENT_DATA</code> as the value for <code>ComplianceType</code> from a <code>PutEvaluations</code> request. For example, an Lambda function for a custom Config rule cannot pass an <code>INSUFFICIENT_DATA</code> value to Config.</p>
pub fn compliance_type(&self) -> &crate::types::ComplianceType {
&self.compliance_type
}
/// <p>Supplementary information about how the evaluation determined the compliance.</p>
pub fn annotation(&self) -> ::std::option::Option<&str> {
self.annotation.as_deref()
}
/// <p>The time of the event in Config that triggered the evaluation. For event-based evaluations, the time indicates when Config created the configuration item that triggered the evaluation. For periodic evaluations, the time indicates when Config triggered the evaluation at the frequency that you specified (for example, every 24 hours).</p>
pub fn ordering_timestamp(&self) -> &::aws_smithy_types::DateTime {
&self.ordering_timestamp
}
}
impl Evaluation {
/// Creates a new builder-style object to manufacture [`Evaluation`](crate::types::Evaluation).
pub fn builder() -> crate::types::builders::EvaluationBuilder {
crate::types::builders::EvaluationBuilder::default()
}
}
/// A builder for [`Evaluation`](crate::types::Evaluation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EvaluationBuilder {
pub(crate) compliance_resource_type: ::std::option::Option<::std::string::String>,
pub(crate) compliance_resource_id: ::std::option::Option<::std::string::String>,
pub(crate) compliance_type: ::std::option::Option<crate::types::ComplianceType>,
pub(crate) annotation: ::std::option::Option<::std::string::String>,
pub(crate) ordering_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl EvaluationBuilder {
/// <p>The type of Amazon Web Services resource that was evaluated.</p>
/// This field is required.
pub fn compliance_resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.compliance_resource_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of Amazon Web Services resource that was evaluated.</p>
pub fn set_compliance_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.compliance_resource_type = input;
self
}
/// <p>The type of Amazon Web Services resource that was evaluated.</p>
pub fn get_compliance_resource_type(&self) -> &::std::option::Option<::std::string::String> {
&self.compliance_resource_type
}
/// <p>The ID of the Amazon Web Services resource that was evaluated.</p>
/// This field is required.
pub fn compliance_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.compliance_resource_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services resource that was evaluated.</p>
pub fn set_compliance_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.compliance_resource_id = input;
self
}
/// <p>The ID of the Amazon Web Services resource that was evaluated.</p>
pub fn get_compliance_resource_id(&self) -> &::std::option::Option<::std::string::String> {
&self.compliance_resource_id
}
/// <p>Indicates whether the Amazon Web Services resource complies with the Config rule that it was evaluated against.</p>
/// <p>For the <code>Evaluation</code> data type, Config supports only the <code>COMPLIANT</code>, <code>NON_COMPLIANT</code>, and <code>NOT_APPLICABLE</code> values. Config does not support the <code>INSUFFICIENT_DATA</code> value for this data type.</p>
/// <p>Similarly, Config does not accept <code>INSUFFICIENT_DATA</code> as the value for <code>ComplianceType</code> from a <code>PutEvaluations</code> request. For example, an Lambda function for a custom Config rule cannot pass an <code>INSUFFICIENT_DATA</code> value to Config.</p>
/// This field is required.
pub fn compliance_type(mut self, input: crate::types::ComplianceType) -> Self {
self.compliance_type = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the Amazon Web Services resource complies with the Config rule that it was evaluated against.</p>
/// <p>For the <code>Evaluation</code> data type, Config supports only the <code>COMPLIANT</code>, <code>NON_COMPLIANT</code>, and <code>NOT_APPLICABLE</code> values. Config does not support the <code>INSUFFICIENT_DATA</code> value for this data type.</p>
/// <p>Similarly, Config does not accept <code>INSUFFICIENT_DATA</code> as the value for <code>ComplianceType</code> from a <code>PutEvaluations</code> request. For example, an Lambda function for a custom Config rule cannot pass an <code>INSUFFICIENT_DATA</code> value to Config.</p>
pub fn set_compliance_type(mut self, input: ::std::option::Option<crate::types::ComplianceType>) -> Self {
self.compliance_type = input;
self
}
/// <p>Indicates whether the Amazon Web Services resource complies with the Config rule that it was evaluated against.</p>
/// <p>For the <code>Evaluation</code> data type, Config supports only the <code>COMPLIANT</code>, <code>NON_COMPLIANT</code>, and <code>NOT_APPLICABLE</code> values. Config does not support the <code>INSUFFICIENT_DATA</code> value for this data type.</p>
/// <p>Similarly, Config does not accept <code>INSUFFICIENT_DATA</code> as the value for <code>ComplianceType</code> from a <code>PutEvaluations</code> request. For example, an Lambda function for a custom Config rule cannot pass an <code>INSUFFICIENT_DATA</code> value to Config.</p>
pub fn get_compliance_type(&self) -> &::std::option::Option<crate::types::ComplianceType> {
&self.compliance_type
}
/// <p>Supplementary information about how the evaluation determined the compliance.</p>
pub fn annotation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.annotation = ::std::option::Option::Some(input.into());
self
}
/// <p>Supplementary information about how the evaluation determined the compliance.</p>
pub fn set_annotation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.annotation = input;
self
}
/// <p>Supplementary information about how the evaluation determined the compliance.</p>
pub fn get_annotation(&self) -> &::std::option::Option<::std::string::String> {
&self.annotation
}
/// <p>The time of the event in Config that triggered the evaluation. For event-based evaluations, the time indicates when Config created the configuration item that triggered the evaluation. For periodic evaluations, the time indicates when Config triggered the evaluation at the frequency that you specified (for example, every 24 hours).</p>
/// This field is required.
pub fn ordering_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.ordering_timestamp = ::std::option::Option::Some(input);
self
}
/// <p>The time of the event in Config that triggered the evaluation. For event-based evaluations, the time indicates when Config created the configuration item that triggered the evaluation. For periodic evaluations, the time indicates when Config triggered the evaluation at the frequency that you specified (for example, every 24 hours).</p>
pub fn set_ordering_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.ordering_timestamp = input;
self
}
/// <p>The time of the event in Config that triggered the evaluation. For event-based evaluations, the time indicates when Config created the configuration item that triggered the evaluation. For periodic evaluations, the time indicates when Config triggered the evaluation at the frequency that you specified (for example, every 24 hours).</p>
pub fn get_ordering_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.ordering_timestamp
}
/// Consumes the builder and constructs a [`Evaluation`](crate::types::Evaluation).
/// This method will fail if any of the following fields are not set:
/// - [`compliance_resource_type`](crate::types::builders::EvaluationBuilder::compliance_resource_type)
/// - [`compliance_resource_id`](crate::types::builders::EvaluationBuilder::compliance_resource_id)
/// - [`compliance_type`](crate::types::builders::EvaluationBuilder::compliance_type)
/// - [`ordering_timestamp`](crate::types::builders::EvaluationBuilder::ordering_timestamp)
pub fn build(self) -> ::std::result::Result<crate::types::Evaluation, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Evaluation {
compliance_resource_type: self.compliance_resource_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"compliance_resource_type",
"compliance_resource_type was not specified but it is required when building Evaluation",
)
})?,
compliance_resource_id: self.compliance_resource_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"compliance_resource_id",
"compliance_resource_id was not specified but it is required when building Evaluation",
)
})?,
compliance_type: self.compliance_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"compliance_type",
"compliance_type was not specified but it is required when building Evaluation",
)
})?,
annotation: self.annotation,
ordering_timestamp: self.ordering_timestamp.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"ordering_timestamp",
"ordering_timestamp was not specified but it is required when building Evaluation",
)
})?,
})
}
}