Struct aws_sdk_batch::model::update_policy::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for UpdatePolicy
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn terminate_jobs_on_update(self, input: bool) -> Self
pub fn terminate_jobs_on_update(self, input: bool) -> Self
Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated. The default value is false
.
sourcepub fn set_terminate_jobs_on_update(self, input: Option<bool>) -> Self
pub fn set_terminate_jobs_on_update(self, input: Option<bool>) -> Self
Specifies whether jobs are automatically terminated when the computer environment infrastructure is updated. The default value is false
.
Examples found in repository?
src/json_deser.rs (lines 2458-2462)
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494
pub(crate) fn deser_structure_crate_model_update_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::UpdatePolicy>, 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::update_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() {
"terminateJobsOnUpdate" => {
builder = builder.set_terminate_jobs_on_update(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"jobExecutionTimeoutMinutes" => {
builder = builder.set_job_execution_timeout_minutes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::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 job_execution_timeout_minutes(self, input: i64) -> Self
pub fn job_execution_timeout_minutes(self, input: i64) -> Self
Specifies the job timeout, in minutes, when the compute environment infrastructure is updated. The default value is 30.
sourcepub fn set_job_execution_timeout_minutes(self, input: Option<i64>) -> Self
pub fn set_job_execution_timeout_minutes(self, input: Option<i64>) -> Self
Specifies the job timeout, in minutes, when the compute environment infrastructure is updated. The default value is 30.
Examples found in repository?
src/json_deser.rs (lines 2465-2471)
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494
pub(crate) fn deser_structure_crate_model_update_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::UpdatePolicy>, 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::update_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() {
"terminateJobsOnUpdate" => {
builder = builder.set_terminate_jobs_on_update(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"jobExecutionTimeoutMinutes" => {
builder = builder.set_job_execution_timeout_minutes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::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) -> UpdatePolicy
pub fn build(self) -> UpdatePolicy
Consumes the builder and constructs a UpdatePolicy
.
Examples found in repository?
src/json_deser.rs (line 2486)
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494
pub(crate) fn deser_structure_crate_model_update_policy<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<Option<crate::model::UpdatePolicy>, 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::update_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() {
"terminateJobsOnUpdate" => {
builder = builder.set_terminate_jobs_on_update(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"jobExecutionTimeoutMinutes" => {
builder = builder.set_job_execution_timeout_minutes(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i64::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",
),
),
}
}