Struct aws_sdk_computeoptimizer::model::lambda_function_memory_recommendation_option::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for LambdaFunctionMemoryRecommendationOption
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn rank(self, input: i32) -> Self
pub fn rank(self, input: i32) -> Self
The rank of the function recommendation option.
The top recommendation option is ranked as 1
.
sourcepub fn set_rank(self, input: Option<i32>) -> Self
pub fn set_rank(self, input: Option<i32>) -> Self
The rank of the function recommendation option.
The top recommendation option is ranked as 1
.
Examples found in repository?
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899
pub(crate) fn deser_structure_crate_model_lambda_function_memory_recommendation_option<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LambdaFunctionMemoryRecommendationOption>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder =
crate::model::lambda_function_memory_recommendation_option::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"rank" => {
builder = builder.set_rank(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"memorySize" => {
builder = builder.set_memory_size(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"projectedUtilizationMetrics" => {
builder = builder.set_projected_utilization_metrics(
crate::json_deser::deser_list_com_amazonaws_computeoptimizer_lambda_function_memory_projected_metrics(tokens)?
);
}
"savingsOpportunity" => {
builder = builder.set_savings_opportunity(
crate::json_deser::deser_structure_crate_model_savings_opportunity(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn memory_size(self, input: i32) -> Self
pub fn memory_size(self, input: i32) -> Self
The memory size, in MB, of the function recommendation option.
sourcepub fn set_memory_size(self, input: Option<i32>) -> Self
pub fn set_memory_size(self, input: Option<i32>) -> Self
The memory size, in MB, of the function recommendation option.
Examples found in repository?
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899
pub(crate) fn deser_structure_crate_model_lambda_function_memory_recommendation_option<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LambdaFunctionMemoryRecommendationOption>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder =
crate::model::lambda_function_memory_recommendation_option::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"rank" => {
builder = builder.set_rank(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"memorySize" => {
builder = builder.set_memory_size(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"projectedUtilizationMetrics" => {
builder = builder.set_projected_utilization_metrics(
crate::json_deser::deser_list_com_amazonaws_computeoptimizer_lambda_function_memory_projected_metrics(tokens)?
);
}
"savingsOpportunity" => {
builder = builder.set_savings_opportunity(
crate::json_deser::deser_structure_crate_model_savings_opportunity(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn projected_utilization_metrics(
self,
input: LambdaFunctionMemoryProjectedMetric
) -> Self
pub fn projected_utilization_metrics(
self,
input: LambdaFunctionMemoryProjectedMetric
) -> Self
Appends an item to projected_utilization_metrics
.
To override the contents of this collection use set_projected_utilization_metrics
.
An array of objects that describe the projected utilization metrics of the function recommendation option.
sourcepub fn set_projected_utilization_metrics(
self,
input: Option<Vec<LambdaFunctionMemoryProjectedMetric>>
) -> Self
pub fn set_projected_utilization_metrics(
self,
input: Option<Vec<LambdaFunctionMemoryProjectedMetric>>
) -> Self
An array of objects that describe the projected utilization metrics of the function recommendation option.
Examples found in repository?
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899
pub(crate) fn deser_structure_crate_model_lambda_function_memory_recommendation_option<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LambdaFunctionMemoryRecommendationOption>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder =
crate::model::lambda_function_memory_recommendation_option::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"rank" => {
builder = builder.set_rank(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"memorySize" => {
builder = builder.set_memory_size(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"projectedUtilizationMetrics" => {
builder = builder.set_projected_utilization_metrics(
crate::json_deser::deser_list_com_amazonaws_computeoptimizer_lambda_function_memory_projected_metrics(tokens)?
);
}
"savingsOpportunity" => {
builder = builder.set_savings_opportunity(
crate::json_deser::deser_structure_crate_model_savings_opportunity(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn savings_opportunity(self, input: SavingsOpportunity) -> Self
pub fn savings_opportunity(self, input: SavingsOpportunity) -> Self
An object that describes the savings opportunity for the Lambda function recommendation option. Savings opportunity includes the estimated monthly savings amount and percentage.
sourcepub fn set_savings_opportunity(self, input: Option<SavingsOpportunity>) -> Self
pub fn set_savings_opportunity(self, input: Option<SavingsOpportunity>) -> Self
An object that describes the savings opportunity for the Lambda function recommendation option. Savings opportunity includes the estimated monthly savings amount and percentage.
Examples found in repository?
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899
pub(crate) fn deser_structure_crate_model_lambda_function_memory_recommendation_option<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LambdaFunctionMemoryRecommendationOption>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder =
crate::model::lambda_function_memory_recommendation_option::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"rank" => {
builder = builder.set_rank(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"memorySize" => {
builder = builder.set_memory_size(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"projectedUtilizationMetrics" => {
builder = builder.set_projected_utilization_metrics(
crate::json_deser::deser_list_com_amazonaws_computeoptimizer_lambda_function_memory_projected_metrics(tokens)?
);
}
"savingsOpportunity" => {
builder = builder.set_savings_opportunity(
crate::json_deser::deser_structure_crate_model_savings_opportunity(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> LambdaFunctionMemoryRecommendationOption
pub fn build(self) -> LambdaFunctionMemoryRecommendationOption
Consumes the builder and constructs a LambdaFunctionMemoryRecommendationOption
.
Examples found in repository?
4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899
pub(crate) fn deser_structure_crate_model_lambda_function_memory_recommendation_option<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::LambdaFunctionMemoryRecommendationOption>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder =
crate::model::lambda_function_memory_recommendation_option::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"rank" => {
builder = builder.set_rank(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"memorySize" => {
builder = builder.set_memory_size(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"projectedUtilizationMetrics" => {
builder = builder.set_projected_utilization_metrics(
crate::json_deser::deser_list_com_amazonaws_computeoptimizer_lambda_function_memory_projected_metrics(tokens)?
);
}
"savingsOpportunity" => {
builder = builder.set_savings_opportunity(
crate::json_deser::deser_structure_crate_model_savings_opportunity(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}