Struct aws_sdk_ec2::model::instance_usage::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for InstanceUsage
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn account_id(self, input: impl Into<String>) -> Self
pub fn account_id(self, input: impl Into<String>) -> Self
The ID of the Amazon Web Services account that is making use of the Capacity Reservation.
sourcepub fn set_account_id(self, input: Option<String>) -> Self
pub fn set_account_id(self, input: Option<String>) -> Self
The ID of the Amazon Web Services account that is making use of the Capacity Reservation.
Examples found in repository?
src/xml_deser.rs (line 52163)
52146 52147 52148 52149 52150 52151 52152 52153 52154 52155 52156 52157 52158 52159 52160 52161 52162 52163 52164 52165 52166 52167 52168 52169 52170 52171 52172 52173 52174 52175 52176 52177 52178 52179 52180 52181 52182 52183 52184 52185
pub fn deser_structure_crate_model_instance_usage(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceUsage, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceUsage::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("accountId") /* AccountId com.amazonaws.ec2#InstanceUsage$AccountId */ => {
let var_2485 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_account_id(var_2485);
}
,
s if s.matches("usedInstanceCount") /* UsedInstanceCount com.amazonaws.ec2#InstanceUsage$UsedInstanceCount */ => {
let var_2486 =
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_used_instance_count(var_2486);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn used_instance_count(self, input: i32) -> Self
pub fn used_instance_count(self, input: i32) -> Self
The number of instances the Amazon Web Services account currently has in the Capacity Reservation.
sourcepub fn set_used_instance_count(self, input: Option<i32>) -> Self
pub fn set_used_instance_count(self, input: Option<i32>) -> Self
The number of instances the Amazon Web Services account currently has in the Capacity Reservation.
Examples found in repository?
src/xml_deser.rs (line 52178)
52146 52147 52148 52149 52150 52151 52152 52153 52154 52155 52156 52157 52158 52159 52160 52161 52162 52163 52164 52165 52166 52167 52168 52169 52170 52171 52172 52173 52174 52175 52176 52177 52178 52179 52180 52181 52182 52183 52184 52185
pub fn deser_structure_crate_model_instance_usage(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceUsage, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceUsage::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("accountId") /* AccountId com.amazonaws.ec2#InstanceUsage$AccountId */ => {
let var_2485 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_account_id(var_2485);
}
,
s if s.matches("usedInstanceCount") /* UsedInstanceCount com.amazonaws.ec2#InstanceUsage$UsedInstanceCount */ => {
let var_2486 =
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_used_instance_count(var_2486);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> InstanceUsage
pub fn build(self) -> InstanceUsage
Consumes the builder and constructs a InstanceUsage
.
Examples found in repository?
src/xml_deser.rs (line 52184)
52146 52147 52148 52149 52150 52151 52152 52153 52154 52155 52156 52157 52158 52159 52160 52161 52162 52163 52164 52165 52166 52167 52168 52169 52170 52171 52172 52173 52174 52175 52176 52177 52178 52179 52180 52181 52182 52183 52184 52185
pub fn deser_structure_crate_model_instance_usage(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceUsage, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::InstanceUsage::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("accountId") /* AccountId com.amazonaws.ec2#InstanceUsage$AccountId */ => {
let var_2485 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_account_id(var_2485);
}
,
s if s.matches("usedInstanceCount") /* UsedInstanceCount com.amazonaws.ec2#InstanceUsage$UsedInstanceCount */ => {
let var_2486 =
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_used_instance_count(var_2486);
}
,
_ => {}
}
}
Ok(builder.build())
}