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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A potential improvement that was found from analyzing the profiling data.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recommendation {
/// <p>How many different places in the profile graph triggered a match.</p>
pub all_matches_count: i32,
/// <p>How much of the total sample count is potentially affected.</p>
pub all_matches_sum: f64,
/// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
pub pattern: ::std::option::Option<crate::types::Pattern>,
/// <p>List of the matches with most impact.</p>
pub top_matches: ::std::vec::Vec<crate::types::Match>,
/// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub start_time: ::aws_smithy_types::DateTime,
/// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub end_time: ::aws_smithy_types::DateTime,
}
impl Recommendation {
/// <p>How many different places in the profile graph triggered a match.</p>
pub fn all_matches_count(&self) -> i32 {
self.all_matches_count
}
/// <p>How much of the total sample count is potentially affected.</p>
pub fn all_matches_sum(&self) -> f64 {
self.all_matches_sum
}
/// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
pub fn pattern(&self) -> ::std::option::Option<&crate::types::Pattern> {
self.pattern.as_ref()
}
/// <p>List of the matches with most impact.</p>
pub fn top_matches(&self) -> &[crate::types::Match] {
use std::ops::Deref;
self.top_matches.deref()
}
/// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
&self.start_time
}
/// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
&self.end_time
}
}
impl Recommendation {
/// Creates a new builder-style object to manufacture [`Recommendation`](crate::types::Recommendation).
pub fn builder() -> crate::types::builders::RecommendationBuilder {
crate::types::builders::RecommendationBuilder::default()
}
}
/// A builder for [`Recommendation`](crate::types::Recommendation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RecommendationBuilder {
pub(crate) all_matches_count: ::std::option::Option<i32>,
pub(crate) all_matches_sum: ::std::option::Option<f64>,
pub(crate) pattern: ::std::option::Option<crate::types::Pattern>,
pub(crate) top_matches: ::std::option::Option<::std::vec::Vec<crate::types::Match>>,
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl RecommendationBuilder {
/// <p>How many different places in the profile graph triggered a match.</p>
/// This field is required.
pub fn all_matches_count(mut self, input: i32) -> Self {
self.all_matches_count = ::std::option::Option::Some(input);
self
}
/// <p>How many different places in the profile graph triggered a match.</p>
pub fn set_all_matches_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.all_matches_count = input;
self
}
/// <p>How many different places in the profile graph triggered a match.</p>
pub fn get_all_matches_count(&self) -> &::std::option::Option<i32> {
&self.all_matches_count
}
/// <p>How much of the total sample count is potentially affected.</p>
/// This field is required.
pub fn all_matches_sum(mut self, input: f64) -> Self {
self.all_matches_sum = ::std::option::Option::Some(input);
self
}
/// <p>How much of the total sample count is potentially affected.</p>
pub fn set_all_matches_sum(mut self, input: ::std::option::Option<f64>) -> Self {
self.all_matches_sum = input;
self
}
/// <p>How much of the total sample count is potentially affected.</p>
pub fn get_all_matches_sum(&self) -> &::std::option::Option<f64> {
&self.all_matches_sum
}
/// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
/// This field is required.
pub fn pattern(mut self, input: crate::types::Pattern) -> Self {
self.pattern = ::std::option::Option::Some(input);
self
}
/// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
pub fn set_pattern(mut self, input: ::std::option::Option<crate::types::Pattern>) -> Self {
self.pattern = input;
self
}
/// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
pub fn get_pattern(&self) -> &::std::option::Option<crate::types::Pattern> {
&self.pattern
}
/// Appends an item to `top_matches`.
///
/// To override the contents of this collection use [`set_top_matches`](Self::set_top_matches).
///
/// <p>List of the matches with most impact.</p>
pub fn top_matches(mut self, input: crate::types::Match) -> Self {
let mut v = self.top_matches.unwrap_or_default();
v.push(input);
self.top_matches = ::std::option::Option::Some(v);
self
}
/// <p>List of the matches with most impact.</p>
pub fn set_top_matches(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Match>>) -> Self {
self.top_matches = input;
self
}
/// <p>List of the matches with most impact.</p>
pub fn get_top_matches(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Match>> {
&self.top_matches
}
/// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
/// This field is required.
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
/// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
/// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
/// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
/// This field is required.
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_time = ::std::option::Option::Some(input);
self
}
/// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_time = input;
self
}
/// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_time
}
/// Consumes the builder and constructs a [`Recommendation`](crate::types::Recommendation).
/// This method will fail if any of the following fields are not set:
/// - [`all_matches_count`](crate::types::builders::RecommendationBuilder::all_matches_count)
/// - [`all_matches_sum`](crate::types::builders::RecommendationBuilder::all_matches_sum)
/// - [`top_matches`](crate::types::builders::RecommendationBuilder::top_matches)
/// - [`start_time`](crate::types::builders::RecommendationBuilder::start_time)
/// - [`end_time`](crate::types::builders::RecommendationBuilder::end_time)
pub fn build(self) -> ::std::result::Result<crate::types::Recommendation, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Recommendation {
all_matches_count: self.all_matches_count.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"all_matches_count",
"all_matches_count was not specified but it is required when building Recommendation",
)
})?,
all_matches_sum: self.all_matches_sum.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"all_matches_sum",
"all_matches_sum was not specified but it is required when building Recommendation",
)
})?,
pattern: self.pattern,
top_matches: self.top_matches.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"top_matches",
"top_matches was not specified but it is required when building Recommendation",
)
})?,
start_time: self.start_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"start_time",
"start_time was not specified but it is required when building Recommendation",
)
})?,
end_time: self.end_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"end_time",
"end_time was not specified but it is required when building Recommendation",
)
})?,
})
}
}