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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p> Describes the recommendation options for an Amazon ECS service. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EcsServiceRecommendationOption {
/// <p> The memory size of the Amazon ECS service recommendation option. </p>
pub memory: ::std::option::Option<i32>,
/// <p> The CPU size of the Amazon ECS service recommendation option. </p>
pub cpu: ::std::option::Option<i32>,
/// <p>Describes the savings opportunity for recommendations of a given resource type or for the recommendation option of an individual resource.</p>
/// <p>Savings opportunity represents the estimated monthly savings you can achieve by implementing a given Compute Optimizer recommendation.</p> <important>
/// <p>Savings opportunity data requires that you opt in to Cost Explorer, as well as activate <b>Receive Amazon EC2 resource recommendations</b> in the Cost Explorer preferences page. That creates a connection between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer generates savings estimates considering the price of existing resources, the price of recommended resources, and historical usage data. Estimated monthly savings reflects the projected dollar savings associated with each of the recommendations generated. For more information, see <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html">Enabling Cost Explorer</a> and <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html">Optimizing your cost with Rightsizing Recommendations</a> in the <i>Cost Management User Guide</i>.</p>
/// </important>
pub savings_opportunity: ::std::option::Option<crate::types::SavingsOpportunity>,
/// <p> An array of objects that describe the projected utilization metrics of the Amazon ECS service recommendation option. </p>
pub projected_utilization_metrics: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceProjectedUtilizationMetric>>,
/// <p> The CPU and memory size recommendations for the containers within the task of your Amazon ECS service. </p>
pub container_recommendations: ::std::option::Option<::std::vec::Vec<crate::types::ContainerRecommendation>>,
/// <p> Describes the savings opportunity for Amazon ECS service recommendations or for the recommendation option. </p>
/// <p>Savings opportunity represents the estimated monthly savings after applying Savings Plans discounts. You can achieve this by implementing a given Compute Optimizer recommendation.</p>
pub savings_opportunity_after_discounts: ::std::option::Option<crate::types::EcsSavingsOpportunityAfterDiscounts>,
}
impl EcsServiceRecommendationOption {
/// <p> The memory size of the Amazon ECS service recommendation option. </p>
pub fn memory(&self) -> ::std::option::Option<i32> {
self.memory
}
/// <p> The CPU size of the Amazon ECS service recommendation option. </p>
pub fn cpu(&self) -> ::std::option::Option<i32> {
self.cpu
}
/// <p>Describes the savings opportunity for recommendations of a given resource type or for the recommendation option of an individual resource.</p>
/// <p>Savings opportunity represents the estimated monthly savings you can achieve by implementing a given Compute Optimizer recommendation.</p> <important>
/// <p>Savings opportunity data requires that you opt in to Cost Explorer, as well as activate <b>Receive Amazon EC2 resource recommendations</b> in the Cost Explorer preferences page. That creates a connection between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer generates savings estimates considering the price of existing resources, the price of recommended resources, and historical usage data. Estimated monthly savings reflects the projected dollar savings associated with each of the recommendations generated. For more information, see <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html">Enabling Cost Explorer</a> and <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html">Optimizing your cost with Rightsizing Recommendations</a> in the <i>Cost Management User Guide</i>.</p>
/// </important>
pub fn savings_opportunity(&self) -> ::std::option::Option<&crate::types::SavingsOpportunity> {
self.savings_opportunity.as_ref()
}
/// <p> An array of objects that describe the projected utilization metrics of the Amazon ECS service recommendation option. </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 `.projected_utilization_metrics.is_none()`.
pub fn projected_utilization_metrics(&self) -> &[crate::types::EcsServiceProjectedUtilizationMetric] {
self.projected_utilization_metrics.as_deref().unwrap_or_default()
}
/// <p> The CPU and memory size recommendations for the containers within the task of your Amazon ECS service. </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 `.container_recommendations.is_none()`.
pub fn container_recommendations(&self) -> &[crate::types::ContainerRecommendation] {
self.container_recommendations.as_deref().unwrap_or_default()
}
/// <p> Describes the savings opportunity for Amazon ECS service recommendations or for the recommendation option. </p>
/// <p>Savings opportunity represents the estimated monthly savings after applying Savings Plans discounts. You can achieve this by implementing a given Compute Optimizer recommendation.</p>
pub fn savings_opportunity_after_discounts(&self) -> ::std::option::Option<&crate::types::EcsSavingsOpportunityAfterDiscounts> {
self.savings_opportunity_after_discounts.as_ref()
}
}
impl EcsServiceRecommendationOption {
/// Creates a new builder-style object to manufacture [`EcsServiceRecommendationOption`](crate::types::EcsServiceRecommendationOption).
pub fn builder() -> crate::types::builders::EcsServiceRecommendationOptionBuilder {
crate::types::builders::EcsServiceRecommendationOptionBuilder::default()
}
}
/// A builder for [`EcsServiceRecommendationOption`](crate::types::EcsServiceRecommendationOption).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EcsServiceRecommendationOptionBuilder {
pub(crate) memory: ::std::option::Option<i32>,
pub(crate) cpu: ::std::option::Option<i32>,
pub(crate) savings_opportunity: ::std::option::Option<crate::types::SavingsOpportunity>,
pub(crate) projected_utilization_metrics: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceProjectedUtilizationMetric>>,
pub(crate) container_recommendations: ::std::option::Option<::std::vec::Vec<crate::types::ContainerRecommendation>>,
pub(crate) savings_opportunity_after_discounts: ::std::option::Option<crate::types::EcsSavingsOpportunityAfterDiscounts>,
}
impl EcsServiceRecommendationOptionBuilder {
/// <p> The memory size of the Amazon ECS service recommendation option. </p>
pub fn memory(mut self, input: i32) -> Self {
self.memory = ::std::option::Option::Some(input);
self
}
/// <p> The memory size of the Amazon ECS service recommendation option. </p>
pub fn set_memory(mut self, input: ::std::option::Option<i32>) -> Self {
self.memory = input;
self
}
/// <p> The memory size of the Amazon ECS service recommendation option. </p>
pub fn get_memory(&self) -> &::std::option::Option<i32> {
&self.memory
}
/// <p> The CPU size of the Amazon ECS service recommendation option. </p>
pub fn cpu(mut self, input: i32) -> Self {
self.cpu = ::std::option::Option::Some(input);
self
}
/// <p> The CPU size of the Amazon ECS service recommendation option. </p>
pub fn set_cpu(mut self, input: ::std::option::Option<i32>) -> Self {
self.cpu = input;
self
}
/// <p> The CPU size of the Amazon ECS service recommendation option. </p>
pub fn get_cpu(&self) -> &::std::option::Option<i32> {
&self.cpu
}
/// <p>Describes the savings opportunity for recommendations of a given resource type or for the recommendation option of an individual resource.</p>
/// <p>Savings opportunity represents the estimated monthly savings you can achieve by implementing a given Compute Optimizer recommendation.</p> <important>
/// <p>Savings opportunity data requires that you opt in to Cost Explorer, as well as activate <b>Receive Amazon EC2 resource recommendations</b> in the Cost Explorer preferences page. That creates a connection between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer generates savings estimates considering the price of existing resources, the price of recommended resources, and historical usage data. Estimated monthly savings reflects the projected dollar savings associated with each of the recommendations generated. For more information, see <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html">Enabling Cost Explorer</a> and <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html">Optimizing your cost with Rightsizing Recommendations</a> in the <i>Cost Management User Guide</i>.</p>
/// </important>
pub fn savings_opportunity(mut self, input: crate::types::SavingsOpportunity) -> Self {
self.savings_opportunity = ::std::option::Option::Some(input);
self
}
/// <p>Describes the savings opportunity for recommendations of a given resource type or for the recommendation option of an individual resource.</p>
/// <p>Savings opportunity represents the estimated monthly savings you can achieve by implementing a given Compute Optimizer recommendation.</p> <important>
/// <p>Savings opportunity data requires that you opt in to Cost Explorer, as well as activate <b>Receive Amazon EC2 resource recommendations</b> in the Cost Explorer preferences page. That creates a connection between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer generates savings estimates considering the price of existing resources, the price of recommended resources, and historical usage data. Estimated monthly savings reflects the projected dollar savings associated with each of the recommendations generated. For more information, see <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html">Enabling Cost Explorer</a> and <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html">Optimizing your cost with Rightsizing Recommendations</a> in the <i>Cost Management User Guide</i>.</p>
/// </important>
pub fn set_savings_opportunity(mut self, input: ::std::option::Option<crate::types::SavingsOpportunity>) -> Self {
self.savings_opportunity = input;
self
}
/// <p>Describes the savings opportunity for recommendations of a given resource type or for the recommendation option of an individual resource.</p>
/// <p>Savings opportunity represents the estimated monthly savings you can achieve by implementing a given Compute Optimizer recommendation.</p> <important>
/// <p>Savings opportunity data requires that you opt in to Cost Explorer, as well as activate <b>Receive Amazon EC2 resource recommendations</b> in the Cost Explorer preferences page. That creates a connection between Cost Explorer and Compute Optimizer. With this connection, Cost Explorer generates savings estimates considering the price of existing resources, the price of recommended resources, and historical usage data. Estimated monthly savings reflects the projected dollar savings associated with each of the recommendations generated. For more information, see <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-enable.html">Enabling Cost Explorer</a> and <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-rightsizing.html">Optimizing your cost with Rightsizing Recommendations</a> in the <i>Cost Management User Guide</i>.</p>
/// </important>
pub fn get_savings_opportunity(&self) -> &::std::option::Option<crate::types::SavingsOpportunity> {
&self.savings_opportunity
}
/// Appends an item to `projected_utilization_metrics`.
///
/// To override the contents of this collection use [`set_projected_utilization_metrics`](Self::set_projected_utilization_metrics).
///
/// <p> An array of objects that describe the projected utilization metrics of the Amazon ECS service recommendation option. </p>
pub fn projected_utilization_metrics(mut self, input: crate::types::EcsServiceProjectedUtilizationMetric) -> Self {
let mut v = self.projected_utilization_metrics.unwrap_or_default();
v.push(input);
self.projected_utilization_metrics = ::std::option::Option::Some(v);
self
}
/// <p> An array of objects that describe the projected utilization metrics of the Amazon ECS service recommendation option. </p>
pub fn set_projected_utilization_metrics(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::EcsServiceProjectedUtilizationMetric>>,
) -> Self {
self.projected_utilization_metrics = input;
self
}
/// <p> An array of objects that describe the projected utilization metrics of the Amazon ECS service recommendation option. </p>
pub fn get_projected_utilization_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EcsServiceProjectedUtilizationMetric>> {
&self.projected_utilization_metrics
}
/// Appends an item to `container_recommendations`.
///
/// To override the contents of this collection use [`set_container_recommendations`](Self::set_container_recommendations).
///
/// <p> The CPU and memory size recommendations for the containers within the task of your Amazon ECS service. </p>
pub fn container_recommendations(mut self, input: crate::types::ContainerRecommendation) -> Self {
let mut v = self.container_recommendations.unwrap_or_default();
v.push(input);
self.container_recommendations = ::std::option::Option::Some(v);
self
}
/// <p> The CPU and memory size recommendations for the containers within the task of your Amazon ECS service. </p>
pub fn set_container_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContainerRecommendation>>) -> Self {
self.container_recommendations = input;
self
}
/// <p> The CPU and memory size recommendations for the containers within the task of your Amazon ECS service. </p>
pub fn get_container_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContainerRecommendation>> {
&self.container_recommendations
}
/// <p> Describes the savings opportunity for Amazon ECS service recommendations or for the recommendation option. </p>
/// <p>Savings opportunity represents the estimated monthly savings after applying Savings Plans discounts. You can achieve this by implementing a given Compute Optimizer recommendation.</p>
pub fn savings_opportunity_after_discounts(mut self, input: crate::types::EcsSavingsOpportunityAfterDiscounts) -> Self {
self.savings_opportunity_after_discounts = ::std::option::Option::Some(input);
self
}
/// <p> Describes the savings opportunity for Amazon ECS service recommendations or for the recommendation option. </p>
/// <p>Savings opportunity represents the estimated monthly savings after applying Savings Plans discounts. You can achieve this by implementing a given Compute Optimizer recommendation.</p>
pub fn set_savings_opportunity_after_discounts(
mut self,
input: ::std::option::Option<crate::types::EcsSavingsOpportunityAfterDiscounts>,
) -> Self {
self.savings_opportunity_after_discounts = input;
self
}
/// <p> Describes the savings opportunity for Amazon ECS service recommendations or for the recommendation option. </p>
/// <p>Savings opportunity represents the estimated monthly savings after applying Savings Plans discounts. You can achieve this by implementing a given Compute Optimizer recommendation.</p>
pub fn get_savings_opportunity_after_discounts(&self) -> &::std::option::Option<crate::types::EcsSavingsOpportunityAfterDiscounts> {
&self.savings_opportunity_after_discounts
}
/// Consumes the builder and constructs a [`EcsServiceRecommendationOption`](crate::types::EcsServiceRecommendationOption).
pub fn build(self) -> crate::types::EcsServiceRecommendationOption {
crate::types::EcsServiceRecommendationOption {
memory: self.memory,
cpu: self.cpu,
savings_opportunity: self.savings_opportunity,
projected_utilization_metrics: self.projected_utilization_metrics,
container_recommendations: self.container_recommendations,
savings_opportunity_after_discounts: self.savings_opportunity_after_discounts,
}
}
}