aws_sdk_codeguruprofiler/operation/get_recommendations/
_get_recommendations_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetRecommendationsOutput {
7 pub profiling_group_name: ::std::string::String,
9 pub profile_start_time: ::aws_smithy_types::DateTime,
11 pub profile_end_time: ::aws_smithy_types::DateTime,
13 pub recommendations: ::std::vec::Vec<crate::types::Recommendation>,
15 pub anomalies: ::std::vec::Vec<crate::types::Anomaly>,
17 _request_id: Option<String>,
18}
19impl GetRecommendationsOutput {
20 pub fn profiling_group_name(&self) -> &str {
22 use std::ops::Deref;
23 self.profiling_group_name.deref()
24 }
25 pub fn profile_start_time(&self) -> &::aws_smithy_types::DateTime {
27 &self.profile_start_time
28 }
29 pub fn profile_end_time(&self) -> &::aws_smithy_types::DateTime {
31 &self.profile_end_time
32 }
33 pub fn recommendations(&self) -> &[crate::types::Recommendation] {
35 use std::ops::Deref;
36 self.recommendations.deref()
37 }
38 pub fn anomalies(&self) -> &[crate::types::Anomaly] {
40 use std::ops::Deref;
41 self.anomalies.deref()
42 }
43}
44impl ::aws_types::request_id::RequestId for GetRecommendationsOutput {
45 fn request_id(&self) -> Option<&str> {
46 self._request_id.as_deref()
47 }
48}
49impl GetRecommendationsOutput {
50 pub fn builder() -> crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder {
52 crate::operation::get_recommendations::builders::GetRecommendationsOutputBuilder::default()
53 }
54}
55
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct GetRecommendationsOutputBuilder {
60 pub(crate) profiling_group_name: ::std::option::Option<::std::string::String>,
61 pub(crate) profile_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
62 pub(crate) profile_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
63 pub(crate) recommendations: ::std::option::Option<::std::vec::Vec<crate::types::Recommendation>>,
64 pub(crate) anomalies: ::std::option::Option<::std::vec::Vec<crate::types::Anomaly>>,
65 _request_id: Option<String>,
66}
67impl GetRecommendationsOutputBuilder {
68 pub fn profiling_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.profiling_group_name = ::std::option::Option::Some(input.into());
72 self
73 }
74 pub fn set_profiling_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.profiling_group_name = input;
77 self
78 }
79 pub fn get_profiling_group_name(&self) -> &::std::option::Option<::std::string::String> {
81 &self.profiling_group_name
82 }
83 pub fn profile_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
86 self.profile_start_time = ::std::option::Option::Some(input);
87 self
88 }
89 pub fn set_profile_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
91 self.profile_start_time = input;
92 self
93 }
94 pub fn get_profile_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
96 &self.profile_start_time
97 }
98 pub fn profile_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
101 self.profile_end_time = ::std::option::Option::Some(input);
102 self
103 }
104 pub fn set_profile_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
106 self.profile_end_time = input;
107 self
108 }
109 pub fn get_profile_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
111 &self.profile_end_time
112 }
113 pub fn recommendations(mut self, input: crate::types::Recommendation) -> Self {
119 let mut v = self.recommendations.unwrap_or_default();
120 v.push(input);
121 self.recommendations = ::std::option::Option::Some(v);
122 self
123 }
124 pub fn set_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Recommendation>>) -> Self {
126 self.recommendations = input;
127 self
128 }
129 pub fn get_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Recommendation>> {
131 &self.recommendations
132 }
133 pub fn anomalies(mut self, input: crate::types::Anomaly) -> Self {
139 let mut v = self.anomalies.unwrap_or_default();
140 v.push(input);
141 self.anomalies = ::std::option::Option::Some(v);
142 self
143 }
144 pub fn set_anomalies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Anomaly>>) -> Self {
146 self.anomalies = input;
147 self
148 }
149 pub fn get_anomalies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Anomaly>> {
151 &self.anomalies
152 }
153 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
154 self._request_id = Some(request_id.into());
155 self
156 }
157
158 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
159 self._request_id = request_id;
160 self
161 }
162 pub fn build(
170 self,
171 ) -> ::std::result::Result<crate::operation::get_recommendations::GetRecommendationsOutput, ::aws_smithy_types::error::operation::BuildError>
172 {
173 ::std::result::Result::Ok(crate::operation::get_recommendations::GetRecommendationsOutput {
174 profiling_group_name: self.profiling_group_name.ok_or_else(|| {
175 ::aws_smithy_types::error::operation::BuildError::missing_field(
176 "profiling_group_name",
177 "profiling_group_name was not specified but it is required when building GetRecommendationsOutput",
178 )
179 })?,
180 profile_start_time: self.profile_start_time.ok_or_else(|| {
181 ::aws_smithy_types::error::operation::BuildError::missing_field(
182 "profile_start_time",
183 "profile_start_time was not specified but it is required when building GetRecommendationsOutput",
184 )
185 })?,
186 profile_end_time: self.profile_end_time.ok_or_else(|| {
187 ::aws_smithy_types::error::operation::BuildError::missing_field(
188 "profile_end_time",
189 "profile_end_time was not specified but it is required when building GetRecommendationsOutput",
190 )
191 })?,
192 recommendations: self.recommendations.ok_or_else(|| {
193 ::aws_smithy_types::error::operation::BuildError::missing_field(
194 "recommendations",
195 "recommendations was not specified but it is required when building GetRecommendationsOutput",
196 )
197 })?,
198 anomalies: self.anomalies.ok_or_else(|| {
199 ::aws_smithy_types::error::operation::BuildError::missing_field(
200 "anomalies",
201 "anomalies was not specified but it is required when building GetRecommendationsOutput",
202 )
203 })?,
204 _request_id: self._request_id,
205 })
206 }
207}