Struct aws_sdk_emr::model::shrink_policy::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for ShrinkPolicy.
Implementations§
source§impl Builder
impl Builder
sourcepub fn decommission_timeout(self, input: i32) -> Self
pub fn decommission_timeout(self, input: i32) -> Self
The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout.
sourcepub fn set_decommission_timeout(self, input: Option<i32>) -> Self
pub fn set_decommission_timeout(self, input: Option<i32>) -> Self
The desired timeout for decommissioning an instance. Overrides the default YARN decommissioning timeout.
Examples found in repository?
src/json_deser.rs (lines 7878-7884)
7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912
pub(crate) fn deser_structure_crate_model_shrink_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::ShrinkPolicy>, 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::shrink_policy::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() {
"DecommissionTimeout" => {
builder = builder.set_decommission_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"InstanceResizePolicy" => {
builder = builder.set_instance_resize_policy(
crate::json_deser::deser_structure_crate_model_instance_resize_policy(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 instance_resize_policy(self, input: InstanceResizePolicy) -> Self
pub fn instance_resize_policy(self, input: InstanceResizePolicy) -> Self
Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.
sourcepub fn set_instance_resize_policy(
self,
input: Option<InstanceResizePolicy>
) -> Self
pub fn set_instance_resize_policy(
self,
input: Option<InstanceResizePolicy>
) -> Self
Custom policy for requesting termination protection or termination of specific instances when shrinking an instance group.
Examples found in repository?
src/json_deser.rs (lines 7887-7889)
7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912
pub(crate) fn deser_structure_crate_model_shrink_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::ShrinkPolicy>, 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::shrink_policy::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() {
"DecommissionTimeout" => {
builder = builder.set_decommission_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"InstanceResizePolicy" => {
builder = builder.set_instance_resize_policy(
crate::json_deser::deser_structure_crate_model_instance_resize_policy(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) -> ShrinkPolicy
pub fn build(self) -> ShrinkPolicy
Consumes the builder and constructs a ShrinkPolicy.
Examples found in repository?
src/json_deser.rs (line 7904)
7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912
pub(crate) fn deser_structure_crate_model_shrink_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::ShrinkPolicy>, 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::shrink_policy::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() {
"DecommissionTimeout" => {
builder = builder.set_decommission_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"InstanceResizePolicy" => {
builder = builder.set_instance_resize_policy(
crate::json_deser::deser_structure_crate_model_instance_resize_policy(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",
),
),
}
}