Struct aws_sdk_appmesh::model::virtual_router_spec::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for VirtualRouterSpec
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn listeners(self, input: VirtualRouterListener) -> Self
pub fn listeners(self, input: VirtualRouterListener) -> Self
Appends an item to listeners
.
To override the contents of this collection use set_listeners
.
The listeners that the virtual router is expected to receive inbound traffic from. You can specify one listener.
sourcepub fn set_listeners(self, input: Option<Vec<VirtualRouterListener>>) -> Self
pub fn set_listeners(self, input: Option<Vec<VirtualRouterListener>>) -> Self
The listeners that the virtual router is expected to receive inbound traffic from. You can specify one listener.
Examples found in repository?
src/json_deser.rs (lines 3696-3698)
3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721
pub(crate) fn deser_structure_crate_model_virtual_router_spec<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::VirtualRouterSpec>,
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::virtual_router_spec::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() {
"listeners" => {
builder = builder.set_listeners(
crate::json_deser::deser_list_com_amazonaws_appmesh_virtual_router_listeners(tokens)?
);
}
_ => 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) -> VirtualRouterSpec
pub fn build(self) -> VirtualRouterSpec
Consumes the builder and constructs a VirtualRouterSpec
.
Examples found in repository?
src/json_deser.rs (line 3713)
3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721
pub(crate) fn deser_structure_crate_model_virtual_router_spec<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::VirtualRouterSpec>,
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::virtual_router_spec::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() {
"listeners" => {
builder = builder.set_listeners(
crate::json_deser::deser_list_com_amazonaws_appmesh_virtual_router_listeners(tokens)?
);
}
_ => 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",
),
),
}
}