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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes the effective recommendation preferences for Amazon RDS.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RdsEffectiveRecommendationPreferences {
/// <p>Describes the CPU vendor and architecture for Amazon RDS recommendations.</p>
pub cpu_vendor_architectures: ::std::option::Option<::std::vec::Vec<crate::types::CpuVendorArchitecture>>,
/// <p>Describes the activation status of the enhanced infrastructure metrics preference.</p>
/// <p>A status of <code>Active</code> confirms that the preference is applied in the latest recommendation refresh, and a status of <code>Inactive</code> confirms that it's not yet applied to recommendations.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html">Enhanced infrastructure metrics</a> in the <i>Compute Optimizer User Guide</i>.</p>
pub enhanced_infrastructure_metrics: ::std::option::Option<crate::types::EnhancedInfrastructureMetrics>,
/// <p>The number of days the utilization metrics of the Amazon RDS are analyzed.</p>
pub look_back_period: ::std::option::Option<crate::types::LookBackPeriodPreference>,
/// <p>Describes the savings estimation mode preference applied for calculating savings opportunity for Amazon RDS.</p>
pub savings_estimation_mode: ::std::option::Option<crate::types::RdsSavingsEstimationMode>,
}
impl RdsEffectiveRecommendationPreferences {
/// <p>Describes the CPU vendor and architecture for Amazon RDS recommendations.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cpu_vendor_architectures.is_none()`.
pub fn cpu_vendor_architectures(&self) -> &[crate::types::CpuVendorArchitecture] {
self.cpu_vendor_architectures.as_deref().unwrap_or_default()
}
/// <p>Describes the activation status of the enhanced infrastructure metrics preference.</p>
/// <p>A status of <code>Active</code> confirms that the preference is applied in the latest recommendation refresh, and a status of <code>Inactive</code> confirms that it's not yet applied to recommendations.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html">Enhanced infrastructure metrics</a> in the <i>Compute Optimizer User Guide</i>.</p>
pub fn enhanced_infrastructure_metrics(&self) -> ::std::option::Option<&crate::types::EnhancedInfrastructureMetrics> {
self.enhanced_infrastructure_metrics.as_ref()
}
/// <p>The number of days the utilization metrics of the Amazon RDS are analyzed.</p>
pub fn look_back_period(&self) -> ::std::option::Option<&crate::types::LookBackPeriodPreference> {
self.look_back_period.as_ref()
}
/// <p>Describes the savings estimation mode preference applied for calculating savings opportunity for Amazon RDS.</p>
pub fn savings_estimation_mode(&self) -> ::std::option::Option<&crate::types::RdsSavingsEstimationMode> {
self.savings_estimation_mode.as_ref()
}
}
impl RdsEffectiveRecommendationPreferences {
/// Creates a new builder-style object to manufacture [`RdsEffectiveRecommendationPreferences`](crate::types::RdsEffectiveRecommendationPreferences).
pub fn builder() -> crate::types::builders::RdsEffectiveRecommendationPreferencesBuilder {
crate::types::builders::RdsEffectiveRecommendationPreferencesBuilder::default()
}
}
/// A builder for [`RdsEffectiveRecommendationPreferences`](crate::types::RdsEffectiveRecommendationPreferences).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RdsEffectiveRecommendationPreferencesBuilder {
pub(crate) cpu_vendor_architectures: ::std::option::Option<::std::vec::Vec<crate::types::CpuVendorArchitecture>>,
pub(crate) enhanced_infrastructure_metrics: ::std::option::Option<crate::types::EnhancedInfrastructureMetrics>,
pub(crate) look_back_period: ::std::option::Option<crate::types::LookBackPeriodPreference>,
pub(crate) savings_estimation_mode: ::std::option::Option<crate::types::RdsSavingsEstimationMode>,
}
impl RdsEffectiveRecommendationPreferencesBuilder {
/// Appends an item to `cpu_vendor_architectures`.
///
/// To override the contents of this collection use [`set_cpu_vendor_architectures`](Self::set_cpu_vendor_architectures).
///
/// <p>Describes the CPU vendor and architecture for Amazon RDS recommendations.</p>
pub fn cpu_vendor_architectures(mut self, input: crate::types::CpuVendorArchitecture) -> Self {
let mut v = self.cpu_vendor_architectures.unwrap_or_default();
v.push(input);
self.cpu_vendor_architectures = ::std::option::Option::Some(v);
self
}
/// <p>Describes the CPU vendor and architecture for Amazon RDS recommendations.</p>
pub fn set_cpu_vendor_architectures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CpuVendorArchitecture>>) -> Self {
self.cpu_vendor_architectures = input;
self
}
/// <p>Describes the CPU vendor and architecture for Amazon RDS recommendations.</p>
pub fn get_cpu_vendor_architectures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CpuVendorArchitecture>> {
&self.cpu_vendor_architectures
}
/// <p>Describes the activation status of the enhanced infrastructure metrics preference.</p>
/// <p>A status of <code>Active</code> confirms that the preference is applied in the latest recommendation refresh, and a status of <code>Inactive</code> confirms that it's not yet applied to recommendations.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html">Enhanced infrastructure metrics</a> in the <i>Compute Optimizer User Guide</i>.</p>
pub fn enhanced_infrastructure_metrics(mut self, input: crate::types::EnhancedInfrastructureMetrics) -> Self {
self.enhanced_infrastructure_metrics = ::std::option::Option::Some(input);
self
}
/// <p>Describes the activation status of the enhanced infrastructure metrics preference.</p>
/// <p>A status of <code>Active</code> confirms that the preference is applied in the latest recommendation refresh, and a status of <code>Inactive</code> confirms that it's not yet applied to recommendations.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html">Enhanced infrastructure metrics</a> in the <i>Compute Optimizer User Guide</i>.</p>
pub fn set_enhanced_infrastructure_metrics(mut self, input: ::std::option::Option<crate::types::EnhancedInfrastructureMetrics>) -> Self {
self.enhanced_infrastructure_metrics = input;
self
}
/// <p>Describes the activation status of the enhanced infrastructure metrics preference.</p>
/// <p>A status of <code>Active</code> confirms that the preference is applied in the latest recommendation refresh, and a status of <code>Inactive</code> confirms that it's not yet applied to recommendations.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/enhanced-infrastructure-metrics.html">Enhanced infrastructure metrics</a> in the <i>Compute Optimizer User Guide</i>.</p>
pub fn get_enhanced_infrastructure_metrics(&self) -> &::std::option::Option<crate::types::EnhancedInfrastructureMetrics> {
&self.enhanced_infrastructure_metrics
}
/// <p>The number of days the utilization metrics of the Amazon RDS are analyzed.</p>
pub fn look_back_period(mut self, input: crate::types::LookBackPeriodPreference) -> Self {
self.look_back_period = ::std::option::Option::Some(input);
self
}
/// <p>The number of days the utilization metrics of the Amazon RDS are analyzed.</p>
pub fn set_look_back_period(mut self, input: ::std::option::Option<crate::types::LookBackPeriodPreference>) -> Self {
self.look_back_period = input;
self
}
/// <p>The number of days the utilization metrics of the Amazon RDS are analyzed.</p>
pub fn get_look_back_period(&self) -> &::std::option::Option<crate::types::LookBackPeriodPreference> {
&self.look_back_period
}
/// <p>Describes the savings estimation mode preference applied for calculating savings opportunity for Amazon RDS.</p>
pub fn savings_estimation_mode(mut self, input: crate::types::RdsSavingsEstimationMode) -> Self {
self.savings_estimation_mode = ::std::option::Option::Some(input);
self
}
/// <p>Describes the savings estimation mode preference applied for calculating savings opportunity for Amazon RDS.</p>
pub fn set_savings_estimation_mode(mut self, input: ::std::option::Option<crate::types::RdsSavingsEstimationMode>) -> Self {
self.savings_estimation_mode = input;
self
}
/// <p>Describes the savings estimation mode preference applied for calculating savings opportunity for Amazon RDS.</p>
pub fn get_savings_estimation_mode(&self) -> &::std::option::Option<crate::types::RdsSavingsEstimationMode> {
&self.savings_estimation_mode
}
/// Consumes the builder and constructs a [`RdsEffectiveRecommendationPreferences`](crate::types::RdsEffectiveRecommendationPreferences).
pub fn build(self) -> crate::types::RdsEffectiveRecommendationPreferences {
crate::types::RdsEffectiveRecommendationPreferences {
cpu_vendor_architectures: self.cpu_vendor_architectures,
enhanced_infrastructure_metrics: self.enhanced_infrastructure_metrics,
look_back_period: self.look_back_period,
savings_estimation_mode: self.savings_estimation_mode,
}
}
}