Struct aws_sdk_emr::model::instance_resize_policy::Builder
source · pub struct Builder { /* private fields */ }Expand description
A builder for InstanceResizePolicy.
Implementations§
source§impl Builder
impl Builder
sourcepub fn instances_to_terminate(self, input: impl Into<String>) -> Self
pub fn instances_to_terminate(self, input: impl Into<String>) -> Self
Appends an item to instances_to_terminate.
To override the contents of this collection use set_instances_to_terminate.
Specific list of instances to be terminated when shrinking an instance group.
sourcepub fn set_instances_to_terminate(self, input: Option<Vec<String>>) -> Self
pub fn set_instances_to_terminate(self, input: Option<Vec<String>>) -> Self
Specific list of instances to be terminated when shrinking an instance group.
Examples found in repository?
8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058
pub(crate) fn deser_structure_crate_model_instance_resize_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::InstanceResizePolicy>,
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::instance_resize_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() {
"InstancesToTerminate" => {
builder = builder.set_instances_to_terminate(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstancesToProtect" => {
builder = builder.set_instances_to_protect(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstanceTerminationTimeout" => {
builder = builder.set_instance_termination_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => 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 instances_to_protect(self, input: impl Into<String>) -> Self
pub fn instances_to_protect(self, input: impl Into<String>) -> Self
Appends an item to instances_to_protect.
To override the contents of this collection use set_instances_to_protect.
Specific list of instances to be protected when shrinking an instance group.
sourcepub fn set_instances_to_protect(self, input: Option<Vec<String>>) -> Self
pub fn set_instances_to_protect(self, input: Option<Vec<String>>) -> Self
Specific list of instances to be protected when shrinking an instance group.
Examples found in repository?
8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058
pub(crate) fn deser_structure_crate_model_instance_resize_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::InstanceResizePolicy>,
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::instance_resize_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() {
"InstancesToTerminate" => {
builder = builder.set_instances_to_terminate(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstancesToProtect" => {
builder = builder.set_instances_to_protect(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstanceTerminationTimeout" => {
builder = builder.set_instance_termination_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => 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_termination_timeout(self, input: i32) -> Self
pub fn instance_termination_timeout(self, input: i32) -> Self
Decommissioning timeout override for the specific list of instances to be terminated.
sourcepub fn set_instance_termination_timeout(self, input: Option<i32>) -> Self
pub fn set_instance_termination_timeout(self, input: Option<i32>) -> Self
Decommissioning timeout override for the specific list of instances to be terminated.
Examples found in repository?
8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058
pub(crate) fn deser_structure_crate_model_instance_resize_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::InstanceResizePolicy>,
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::instance_resize_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() {
"InstancesToTerminate" => {
builder = builder.set_instances_to_terminate(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstancesToProtect" => {
builder = builder.set_instances_to_protect(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstanceTerminationTimeout" => {
builder = builder.set_instance_termination_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => 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) -> InstanceResizePolicy
pub fn build(self) -> InstanceResizePolicy
Consumes the builder and constructs a InstanceResizePolicy.
Examples found in repository?
8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058
pub(crate) fn deser_structure_crate_model_instance_resize_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::InstanceResizePolicy>,
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::instance_resize_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() {
"InstancesToTerminate" => {
builder = builder.set_instances_to_terminate(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstancesToProtect" => {
builder = builder.set_instances_to_protect(
crate::json_deser::deser_list_com_amazonaws_emr_ec2_instance_ids_list(tokens)?
);
}
"InstanceTerminationTimeout" => {
builder = builder.set_instance_termination_timeout(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
_ => 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",
),
),
}
}