Struct aws_sdk_ec2::model::instance_state::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for InstanceState
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn code(self, input: i32) -> Self
pub fn code(self, input: i32) -> Self
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
-
0
:pending
-
16
:running
-
32
:shutting-down
-
48
:terminated
-
64
:stopping
-
80
:stopped
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
sourcepub fn set_code(self, input: Option<i32>) -> Self
pub fn set_code(self, input: Option<i32>) -> Self
The state of the instance as a 16-bit unsigned integer.
The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal values between 256 and 65,535. These numerical values are used for internal purposes and should be ignored.
The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal values between 0 and 255.
The valid values for instance-state-code will all be in the range of the low byte and they are:
-
0
:pending
-
16
:running
-
32
:shutting-down
-
48
:terminated
-
64
:stopping
-
80
:stopped
You can ignore the high byte value by zeroing out all of the bits above 2^8 or 256 in decimal.
Examples found in repository?
59457 59458 59459 59460 59461 59462 59463 59464 59465 59466 59467 59468 59469 59470 59471 59472 59473 59474 59475 59476 59477 59478 59479 59480 59481 59482 59483 59484 59485 59486 59487 59488 59489 59490 59491 59492 59493 59494 59495 59496 59497
pub fn deser_structure_crate_model_instance_state(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceState, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceState::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("code") /* Code com.amazonaws.ec2#InstanceState$Code */ => {
let var_2898 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_code(var_2898);
}
,
s if s.matches("name") /* Name com.amazonaws.ec2#InstanceState$Name */ => {
let var_2899 =
Some(
Result::<crate::model::InstanceStateName, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceStateName::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_name(var_2899);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn name(self, input: InstanceStateName) -> Self
pub fn name(self, input: InstanceStateName) -> Self
The current state of the instance.
sourcepub fn set_name(self, input: Option<InstanceStateName>) -> Self
pub fn set_name(self, input: Option<InstanceStateName>) -> Self
The current state of the instance.
Examples found in repository?
59457 59458 59459 59460 59461 59462 59463 59464 59465 59466 59467 59468 59469 59470 59471 59472 59473 59474 59475 59476 59477 59478 59479 59480 59481 59482 59483 59484 59485 59486 59487 59488 59489 59490 59491 59492 59493 59494 59495 59496 59497
pub fn deser_structure_crate_model_instance_state(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceState, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceState::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("code") /* Code com.amazonaws.ec2#InstanceState$Code */ => {
let var_2898 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_code(var_2898);
}
,
s if s.matches("name") /* Name com.amazonaws.ec2#InstanceState$Name */ => {
let var_2899 =
Some(
Result::<crate::model::InstanceStateName, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceStateName::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_name(var_2899);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> InstanceState
pub fn build(self) -> InstanceState
Consumes the builder and constructs a InstanceState
.
Examples found in repository?
59457 59458 59459 59460 59461 59462 59463 59464 59465 59466 59467 59468 59469 59470 59471 59472 59473 59474 59475 59476 59477 59478 59479 59480 59481 59482 59483 59484 59485 59486 59487 59488 59489 59490 59491 59492 59493 59494 59495 59496 59497
pub fn deser_structure_crate_model_instance_state(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceState, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceState::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("code") /* Code com.amazonaws.ec2#InstanceState$Code */ => {
let var_2898 =
Some(
{
<i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
}
?
)
;
builder = builder.set_code(var_2898);
}
,
s if s.matches("name") /* Name com.amazonaws.ec2#InstanceState$Name */ => {
let var_2899 =
Some(
Result::<crate::model::InstanceStateName, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::InstanceStateName::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_name(var_2899);
}
,
_ => {}
}
}
Ok(builder.build())
}