pub struct Builder { /* private fields */ }
Expand description
A builder for AutoScalingPolicyDescription
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn policy_name(self, input: impl Into<String>) -> Self
pub fn policy_name(self, input: impl Into<String>) -> Self
The name of the scaling policy.
sourcepub fn set_policy_name(self, input: Option<String>) -> Self
pub fn set_policy_name(self, input: Option<String>) -> Self
The name of the scaling policy.
Examples found in repository?
src/json_deser.rs (lines 12071-12077)
12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105
pub(crate) fn deser_structure_crate_model_auto_scaling_policy_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AutoScalingPolicyDescription>,
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::auto_scaling_policy_description::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() {
"PolicyName" => {
builder = builder.set_policy_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"TargetTrackingScalingPolicyConfiguration" => {
builder = builder.set_target_tracking_scaling_policy_configuration(
crate::json_deser::deser_structure_crate_model_auto_scaling_target_tracking_scaling_policy_configuration_description(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 target_tracking_scaling_policy_configuration(
self,
input: AutoScalingTargetTrackingScalingPolicyConfigurationDescription
) -> Self
pub fn target_tracking_scaling_policy_configuration(
self,
input: AutoScalingTargetTrackingScalingPolicyConfigurationDescription
) -> Self
Represents a target tracking scaling policy configuration.
sourcepub fn set_target_tracking_scaling_policy_configuration(
self,
input: Option<AutoScalingTargetTrackingScalingPolicyConfigurationDescription>
) -> Self
pub fn set_target_tracking_scaling_policy_configuration(
self,
input: Option<AutoScalingTargetTrackingScalingPolicyConfigurationDescription>
) -> Self
Represents a target tracking scaling policy configuration.
Examples found in repository?
src/json_deser.rs (lines 12080-12082)
12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105
pub(crate) fn deser_structure_crate_model_auto_scaling_policy_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AutoScalingPolicyDescription>,
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::auto_scaling_policy_description::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() {
"PolicyName" => {
builder = builder.set_policy_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"TargetTrackingScalingPolicyConfiguration" => {
builder = builder.set_target_tracking_scaling_policy_configuration(
crate::json_deser::deser_structure_crate_model_auto_scaling_target_tracking_scaling_policy_configuration_description(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) -> AutoScalingPolicyDescription
pub fn build(self) -> AutoScalingPolicyDescription
Consumes the builder and constructs a AutoScalingPolicyDescription
.
Examples found in repository?
src/json_deser.rs (line 12097)
12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105
pub(crate) fn deser_structure_crate_model_auto_scaling_policy_description<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AutoScalingPolicyDescription>,
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::auto_scaling_policy_description::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() {
"PolicyName" => {
builder = builder.set_policy_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"TargetTrackingScalingPolicyConfiguration" => {
builder = builder.set_target_tracking_scaling_policy_configuration(
crate::json_deser::deser_structure_crate_model_auto_scaling_target_tracking_scaling_policy_configuration_description(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",
),
),
}
}