pub struct Builder { /* private fields */ }
Expand description
A builder for AttachNetworkInterfaceOutput
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn attachment_id(self, input: impl Into<String>) -> Self
pub fn attachment_id(self, input: impl Into<String>) -> Self
The ID of the network interface attachment.
sourcepub fn set_attachment_id(self, input: Option<String>) -> Self
pub fn set_attachment_id(self, input: Option<String>) -> Self
The ID of the network interface attachment.
Examples found in repository?
src/xml_deser.rs (line 1274)
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
pub fn deser_operation_crate_operation_attach_network_interface(
inp: &[u8],
mut builder: crate::output::attach_network_interface_output::Builder,
) -> Result<
crate::output::attach_network_interface_output::Builder,
aws_smithy_xml::decode::XmlDecodeError,
> {
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !(start_el.matches("AttachNetworkInterfaceResponse")) {
return Err(aws_smithy_xml::decode::XmlDecodeError::custom(format!(
"invalid root, expected AttachNetworkInterfaceResponse got {:?}",
start_el
)));
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("attachmentId") /* AttachmentId com.amazonaws.ec2.synthetic#AttachNetworkInterfaceOutput$AttachmentId */ => {
let var_46 =
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_attachment_id(var_46);
}
,
s if s.matches("networkCardIndex") /* NetworkCardIndex com.amazonaws.ec2.synthetic#AttachNetworkInterfaceOutput$NetworkCardIndex */ => {
let var_47 =
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_network_card_index(var_47);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn network_card_index(self, input: i32) -> Self
pub fn network_card_index(self, input: i32) -> Self
The index of the network card.
sourcepub fn set_network_card_index(self, input: Option<i32>) -> Self
pub fn set_network_card_index(self, input: Option<i32>) -> Self
The index of the network card.
Examples found in repository?
src/xml_deser.rs (line 1289)
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
pub fn deser_operation_crate_operation_attach_network_interface(
inp: &[u8],
mut builder: crate::output::attach_network_interface_output::Builder,
) -> Result<
crate::output::attach_network_interface_output::Builder,
aws_smithy_xml::decode::XmlDecodeError,
> {
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !(start_el.matches("AttachNetworkInterfaceResponse")) {
return Err(aws_smithy_xml::decode::XmlDecodeError::custom(format!(
"invalid root, expected AttachNetworkInterfaceResponse got {:?}",
start_el
)));
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("attachmentId") /* AttachmentId com.amazonaws.ec2.synthetic#AttachNetworkInterfaceOutput$AttachmentId */ => {
let var_46 =
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_attachment_id(var_46);
}
,
s if s.matches("networkCardIndex") /* NetworkCardIndex com.amazonaws.ec2.synthetic#AttachNetworkInterfaceOutput$NetworkCardIndex */ => {
let var_47 =
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_network_card_index(var_47);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn build(self) -> AttachNetworkInterfaceOutput
pub fn build(self) -> AttachNetworkInterfaceOutput
Consumes the builder and constructs a AttachNetworkInterfaceOutput
.
Examples found in repository?
src/operation_deser.rs (line 885)
870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887
pub fn parse_attach_network_interface_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AttachNetworkInterfaceOutput,
crate::error::AttachNetworkInterfaceError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::attach_network_interface_output::Builder::default();
let _ = response;
output = crate::xml_deser::deser_operation_crate_operation_attach_network_interface(
response.body().as_ref(),
output,
)
.map_err(crate::error::AttachNetworkInterfaceError::unhandled)?;
output.build()
})
}