aws_sdk_costoptimizationhub/operation/get_recommendation/
_get_recommendation_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetRecommendationOutput {
6 pub recommendation_id: ::std::option::Option<::std::string::String>,
8 pub resource_id: ::std::option::Option<::std::string::String>,
10 pub resource_arn: ::std::option::Option<::std::string::String>,
12 pub account_id: ::std::option::Option<::std::string::String>,
14 pub currency_code: ::std::option::Option<::std::string::String>,
16 pub recommendation_lookback_period_in_days: ::std::option::Option<i32>,
18 pub cost_calculation_lookback_period_in_days: ::std::option::Option<i32>,
20 pub estimated_savings_percentage: ::std::option::Option<f64>,
22 pub estimated_savings_over_cost_calculation_lookback_period: ::std::option::Option<f64>,
24 pub current_resource_type: ::std::option::Option<crate::types::ResourceType>,
26 pub recommended_resource_type: ::std::option::Option<crate::types::ResourceType>,
28 pub region: ::std::option::Option<::std::string::String>,
30 pub source: ::std::option::Option<crate::types::Source>,
32 pub last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
34 pub estimated_monthly_savings: ::std::option::Option<f64>,
36 pub estimated_monthly_cost: ::std::option::Option<f64>,
38 pub implementation_effort: ::std::option::Option<crate::types::ImplementationEffort>,
40 pub restart_needed: ::std::option::Option<bool>,
42 pub action_type: ::std::option::Option<crate::types::ActionType>,
44 pub rollback_possible: ::std::option::Option<bool>,
46 pub current_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
48 pub recommended_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
50 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
52 _request_id: Option<String>,
53}
54impl GetRecommendationOutput {
55 pub fn recommendation_id(&self) -> ::std::option::Option<&str> {
57 self.recommendation_id.as_deref()
58 }
59 pub fn resource_id(&self) -> ::std::option::Option<&str> {
61 self.resource_id.as_deref()
62 }
63 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
65 self.resource_arn.as_deref()
66 }
67 pub fn account_id(&self) -> ::std::option::Option<&str> {
69 self.account_id.as_deref()
70 }
71 pub fn currency_code(&self) -> ::std::option::Option<&str> {
73 self.currency_code.as_deref()
74 }
75 pub fn recommendation_lookback_period_in_days(&self) -> ::std::option::Option<i32> {
77 self.recommendation_lookback_period_in_days
78 }
79 pub fn cost_calculation_lookback_period_in_days(&self) -> ::std::option::Option<i32> {
81 self.cost_calculation_lookback_period_in_days
82 }
83 pub fn estimated_savings_percentage(&self) -> ::std::option::Option<f64> {
85 self.estimated_savings_percentage
86 }
87 pub fn estimated_savings_over_cost_calculation_lookback_period(&self) -> ::std::option::Option<f64> {
89 self.estimated_savings_over_cost_calculation_lookback_period
90 }
91 pub fn current_resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
93 self.current_resource_type.as_ref()
94 }
95 pub fn recommended_resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
97 self.recommended_resource_type.as_ref()
98 }
99 pub fn region(&self) -> ::std::option::Option<&str> {
101 self.region.as_deref()
102 }
103 pub fn source(&self) -> ::std::option::Option<&crate::types::Source> {
105 self.source.as_ref()
106 }
107 pub fn last_refresh_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
109 self.last_refresh_timestamp.as_ref()
110 }
111 pub fn estimated_monthly_savings(&self) -> ::std::option::Option<f64> {
113 self.estimated_monthly_savings
114 }
115 pub fn estimated_monthly_cost(&self) -> ::std::option::Option<f64> {
117 self.estimated_monthly_cost
118 }
119 pub fn implementation_effort(&self) -> ::std::option::Option<&crate::types::ImplementationEffort> {
121 self.implementation_effort.as_ref()
122 }
123 pub fn restart_needed(&self) -> ::std::option::Option<bool> {
125 self.restart_needed
126 }
127 pub fn action_type(&self) -> ::std::option::Option<&crate::types::ActionType> {
129 self.action_type.as_ref()
130 }
131 pub fn rollback_possible(&self) -> ::std::option::Option<bool> {
133 self.rollback_possible
134 }
135 pub fn current_resource_details(&self) -> ::std::option::Option<&crate::types::ResourceDetails> {
137 self.current_resource_details.as_ref()
138 }
139 pub fn recommended_resource_details(&self) -> ::std::option::Option<&crate::types::ResourceDetails> {
141 self.recommended_resource_details.as_ref()
142 }
143 pub fn tags(&self) -> &[crate::types::Tag] {
147 self.tags.as_deref().unwrap_or_default()
148 }
149}
150impl ::aws_types::request_id::RequestId for GetRecommendationOutput {
151 fn request_id(&self) -> Option<&str> {
152 self._request_id.as_deref()
153 }
154}
155impl GetRecommendationOutput {
156 pub fn builder() -> crate::operation::get_recommendation::builders::GetRecommendationOutputBuilder {
158 crate::operation::get_recommendation::builders::GetRecommendationOutputBuilder::default()
159 }
160}
161
162#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
164#[non_exhaustive]
165pub struct GetRecommendationOutputBuilder {
166 pub(crate) recommendation_id: ::std::option::Option<::std::string::String>,
167 pub(crate) resource_id: ::std::option::Option<::std::string::String>,
168 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
169 pub(crate) account_id: ::std::option::Option<::std::string::String>,
170 pub(crate) currency_code: ::std::option::Option<::std::string::String>,
171 pub(crate) recommendation_lookback_period_in_days: ::std::option::Option<i32>,
172 pub(crate) cost_calculation_lookback_period_in_days: ::std::option::Option<i32>,
173 pub(crate) estimated_savings_percentage: ::std::option::Option<f64>,
174 pub(crate) estimated_savings_over_cost_calculation_lookback_period: ::std::option::Option<f64>,
175 pub(crate) current_resource_type: ::std::option::Option<crate::types::ResourceType>,
176 pub(crate) recommended_resource_type: ::std::option::Option<crate::types::ResourceType>,
177 pub(crate) region: ::std::option::Option<::std::string::String>,
178 pub(crate) source: ::std::option::Option<crate::types::Source>,
179 pub(crate) last_refresh_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
180 pub(crate) estimated_monthly_savings: ::std::option::Option<f64>,
181 pub(crate) estimated_monthly_cost: ::std::option::Option<f64>,
182 pub(crate) implementation_effort: ::std::option::Option<crate::types::ImplementationEffort>,
183 pub(crate) restart_needed: ::std::option::Option<bool>,
184 pub(crate) action_type: ::std::option::Option<crate::types::ActionType>,
185 pub(crate) rollback_possible: ::std::option::Option<bool>,
186 pub(crate) current_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
187 pub(crate) recommended_resource_details: ::std::option::Option<crate::types::ResourceDetails>,
188 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
189 _request_id: Option<String>,
190}
191impl GetRecommendationOutputBuilder {
192 pub fn recommendation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.recommendation_id = ::std::option::Option::Some(input.into());
195 self
196 }
197 pub fn set_recommendation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199 self.recommendation_id = input;
200 self
201 }
202 pub fn get_recommendation_id(&self) -> &::std::option::Option<::std::string::String> {
204 &self.recommendation_id
205 }
206 pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208 self.resource_id = ::std::option::Option::Some(input.into());
209 self
210 }
211 pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213 self.resource_id = input;
214 self
215 }
216 pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
218 &self.resource_id
219 }
220 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222 self.resource_arn = ::std::option::Option::Some(input.into());
223 self
224 }
225 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227 self.resource_arn = input;
228 self
229 }
230 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
232 &self.resource_arn
233 }
234 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236 self.account_id = ::std::option::Option::Some(input.into());
237 self
238 }
239 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241 self.account_id = input;
242 self
243 }
244 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
246 &self.account_id
247 }
248 pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250 self.currency_code = ::std::option::Option::Some(input.into());
251 self
252 }
253 pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255 self.currency_code = input;
256 self
257 }
258 pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> {
260 &self.currency_code
261 }
262 pub fn recommendation_lookback_period_in_days(mut self, input: i32) -> Self {
264 self.recommendation_lookback_period_in_days = ::std::option::Option::Some(input);
265 self
266 }
267 pub fn set_recommendation_lookback_period_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
269 self.recommendation_lookback_period_in_days = input;
270 self
271 }
272 pub fn get_recommendation_lookback_period_in_days(&self) -> &::std::option::Option<i32> {
274 &self.recommendation_lookback_period_in_days
275 }
276 pub fn cost_calculation_lookback_period_in_days(mut self, input: i32) -> Self {
278 self.cost_calculation_lookback_period_in_days = ::std::option::Option::Some(input);
279 self
280 }
281 pub fn set_cost_calculation_lookback_period_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
283 self.cost_calculation_lookback_period_in_days = input;
284 self
285 }
286 pub fn get_cost_calculation_lookback_period_in_days(&self) -> &::std::option::Option<i32> {
288 &self.cost_calculation_lookback_period_in_days
289 }
290 pub fn estimated_savings_percentage(mut self, input: f64) -> Self {
292 self.estimated_savings_percentage = ::std::option::Option::Some(input);
293 self
294 }
295 pub fn set_estimated_savings_percentage(mut self, input: ::std::option::Option<f64>) -> Self {
297 self.estimated_savings_percentage = input;
298 self
299 }
300 pub fn get_estimated_savings_percentage(&self) -> &::std::option::Option<f64> {
302 &self.estimated_savings_percentage
303 }
304 pub fn estimated_savings_over_cost_calculation_lookback_period(mut self, input: f64) -> Self {
306 self.estimated_savings_over_cost_calculation_lookback_period = ::std::option::Option::Some(input);
307 self
308 }
309 pub fn set_estimated_savings_over_cost_calculation_lookback_period(mut self, input: ::std::option::Option<f64>) -> Self {
311 self.estimated_savings_over_cost_calculation_lookback_period = input;
312 self
313 }
314 pub fn get_estimated_savings_over_cost_calculation_lookback_period(&self) -> &::std::option::Option<f64> {
316 &self.estimated_savings_over_cost_calculation_lookback_period
317 }
318 pub fn current_resource_type(mut self, input: crate::types::ResourceType) -> Self {
320 self.current_resource_type = ::std::option::Option::Some(input);
321 self
322 }
323 pub fn set_current_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
325 self.current_resource_type = input;
326 self
327 }
328 pub fn get_current_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
330 &self.current_resource_type
331 }
332 pub fn recommended_resource_type(mut self, input: crate::types::ResourceType) -> Self {
334 self.recommended_resource_type = ::std::option::Option::Some(input);
335 self
336 }
337 pub fn set_recommended_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
339 self.recommended_resource_type = input;
340 self
341 }
342 pub fn get_recommended_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
344 &self.recommended_resource_type
345 }
346 pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
348 self.region = ::std::option::Option::Some(input.into());
349 self
350 }
351 pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
353 self.region = input;
354 self
355 }
356 pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
358 &self.region
359 }
360 pub fn source(mut self, input: crate::types::Source) -> Self {
362 self.source = ::std::option::Option::Some(input);
363 self
364 }
365 pub fn set_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
367 self.source = input;
368 self
369 }
370 pub fn get_source(&self) -> &::std::option::Option<crate::types::Source> {
372 &self.source
373 }
374 pub fn last_refresh_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
376 self.last_refresh_timestamp = ::std::option::Option::Some(input);
377 self
378 }
379 pub fn set_last_refresh_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
381 self.last_refresh_timestamp = input;
382 self
383 }
384 pub fn get_last_refresh_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
386 &self.last_refresh_timestamp
387 }
388 pub fn estimated_monthly_savings(mut self, input: f64) -> Self {
390 self.estimated_monthly_savings = ::std::option::Option::Some(input);
391 self
392 }
393 pub fn set_estimated_monthly_savings(mut self, input: ::std::option::Option<f64>) -> Self {
395 self.estimated_monthly_savings = input;
396 self
397 }
398 pub fn get_estimated_monthly_savings(&self) -> &::std::option::Option<f64> {
400 &self.estimated_monthly_savings
401 }
402 pub fn estimated_monthly_cost(mut self, input: f64) -> Self {
404 self.estimated_monthly_cost = ::std::option::Option::Some(input);
405 self
406 }
407 pub fn set_estimated_monthly_cost(mut self, input: ::std::option::Option<f64>) -> Self {
409 self.estimated_monthly_cost = input;
410 self
411 }
412 pub fn get_estimated_monthly_cost(&self) -> &::std::option::Option<f64> {
414 &self.estimated_monthly_cost
415 }
416 pub fn implementation_effort(mut self, input: crate::types::ImplementationEffort) -> Self {
418 self.implementation_effort = ::std::option::Option::Some(input);
419 self
420 }
421 pub fn set_implementation_effort(mut self, input: ::std::option::Option<crate::types::ImplementationEffort>) -> Self {
423 self.implementation_effort = input;
424 self
425 }
426 pub fn get_implementation_effort(&self) -> &::std::option::Option<crate::types::ImplementationEffort> {
428 &self.implementation_effort
429 }
430 pub fn restart_needed(mut self, input: bool) -> Self {
432 self.restart_needed = ::std::option::Option::Some(input);
433 self
434 }
435 pub fn set_restart_needed(mut self, input: ::std::option::Option<bool>) -> Self {
437 self.restart_needed = input;
438 self
439 }
440 pub fn get_restart_needed(&self) -> &::std::option::Option<bool> {
442 &self.restart_needed
443 }
444 pub fn action_type(mut self, input: crate::types::ActionType) -> Self {
446 self.action_type = ::std::option::Option::Some(input);
447 self
448 }
449 pub fn set_action_type(mut self, input: ::std::option::Option<crate::types::ActionType>) -> Self {
451 self.action_type = input;
452 self
453 }
454 pub fn get_action_type(&self) -> &::std::option::Option<crate::types::ActionType> {
456 &self.action_type
457 }
458 pub fn rollback_possible(mut self, input: bool) -> Self {
460 self.rollback_possible = ::std::option::Option::Some(input);
461 self
462 }
463 pub fn set_rollback_possible(mut self, input: ::std::option::Option<bool>) -> Self {
465 self.rollback_possible = input;
466 self
467 }
468 pub fn get_rollback_possible(&self) -> &::std::option::Option<bool> {
470 &self.rollback_possible
471 }
472 pub fn current_resource_details(mut self, input: crate::types::ResourceDetails) -> Self {
474 self.current_resource_details = ::std::option::Option::Some(input);
475 self
476 }
477 pub fn set_current_resource_details(mut self, input: ::std::option::Option<crate::types::ResourceDetails>) -> Self {
479 self.current_resource_details = input;
480 self
481 }
482 pub fn get_current_resource_details(&self) -> &::std::option::Option<crate::types::ResourceDetails> {
484 &self.current_resource_details
485 }
486 pub fn recommended_resource_details(mut self, input: crate::types::ResourceDetails) -> Self {
488 self.recommended_resource_details = ::std::option::Option::Some(input);
489 self
490 }
491 pub fn set_recommended_resource_details(mut self, input: ::std::option::Option<crate::types::ResourceDetails>) -> Self {
493 self.recommended_resource_details = input;
494 self
495 }
496 pub fn get_recommended_resource_details(&self) -> &::std::option::Option<crate::types::ResourceDetails> {
498 &self.recommended_resource_details
499 }
500 pub fn tags(mut self, input: crate::types::Tag) -> Self {
506 let mut v = self.tags.unwrap_or_default();
507 v.push(input);
508 self.tags = ::std::option::Option::Some(v);
509 self
510 }
511 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
513 self.tags = input;
514 self
515 }
516 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
518 &self.tags
519 }
520 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
521 self._request_id = Some(request_id.into());
522 self
523 }
524
525 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
526 self._request_id = request_id;
527 self
528 }
529 pub fn build(self) -> crate::operation::get_recommendation::GetRecommendationOutput {
531 crate::operation::get_recommendation::GetRecommendationOutput {
532 recommendation_id: self.recommendation_id,
533 resource_id: self.resource_id,
534 resource_arn: self.resource_arn,
535 account_id: self.account_id,
536 currency_code: self.currency_code,
537 recommendation_lookback_period_in_days: self.recommendation_lookback_period_in_days,
538 cost_calculation_lookback_period_in_days: self.cost_calculation_lookback_period_in_days,
539 estimated_savings_percentage: self.estimated_savings_percentage,
540 estimated_savings_over_cost_calculation_lookback_period: self.estimated_savings_over_cost_calculation_lookback_period,
541 current_resource_type: self.current_resource_type,
542 recommended_resource_type: self.recommended_resource_type,
543 region: self.region,
544 source: self.source,
545 last_refresh_timestamp: self.last_refresh_timestamp,
546 estimated_monthly_savings: self.estimated_monthly_savings,
547 estimated_monthly_cost: self.estimated_monthly_cost,
548 implementation_effort: self.implementation_effort,
549 restart_needed: self.restart_needed,
550 action_type: self.action_type,
551 rollback_possible: self.rollback_possible,
552 current_resource_details: self.current_resource_details,
553 recommended_resource_details: self.recommended_resource_details,
554 tags: self.tags,
555 _request_id: self._request_id,
556 }
557 }
558}