Struct aws_sdk_networkfirewall::model::rule_variables::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for RuleVariables
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn ip_sets(self, k: impl Into<String>, v: IpSet) -> Self
pub fn ip_sets(self, k: impl Into<String>, v: IpSet) -> Self
Adds a key-value pair to ip_sets
.
To override the contents of this collection use set_ip_sets
.
A list of IP addresses and address ranges, in CIDR notation.
sourcepub fn set_ip_sets(self, input: Option<HashMap<String, IpSet>>) -> Self
pub fn set_ip_sets(self, input: Option<HashMap<String, IpSet>>) -> Self
A list of IP addresses and address ranges, in CIDR notation.
Examples found in repository?
src/json_deser.rs (lines 3941-3943)
3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971
pub(crate) fn deser_structure_crate_model_rule_variables<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::RuleVariables>,
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::rule_variables::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() {
"IPSets" => {
builder = builder.set_ip_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_ip_sets(tokens)?
);
}
"PortSets" => {
builder = builder.set_port_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_port_sets(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 port_sets(self, k: impl Into<String>, v: PortSet) -> Self
pub fn port_sets(self, k: impl Into<String>, v: PortSet) -> Self
Adds a key-value pair to port_sets
.
To override the contents of this collection use set_port_sets
.
A list of port ranges.
sourcepub fn set_port_sets(self, input: Option<HashMap<String, PortSet>>) -> Self
pub fn set_port_sets(self, input: Option<HashMap<String, PortSet>>) -> Self
A list of port ranges.
Examples found in repository?
src/json_deser.rs (lines 3946-3948)
3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971
pub(crate) fn deser_structure_crate_model_rule_variables<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::RuleVariables>,
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::rule_variables::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() {
"IPSets" => {
builder = builder.set_ip_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_ip_sets(tokens)?
);
}
"PortSets" => {
builder = builder.set_port_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_port_sets(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) -> RuleVariables
pub fn build(self) -> RuleVariables
Consumes the builder and constructs a RuleVariables
.
Examples found in repository?
src/json_deser.rs (line 3963)
3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971
pub(crate) fn deser_structure_crate_model_rule_variables<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::RuleVariables>,
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::rule_variables::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() {
"IPSets" => {
builder = builder.set_ip_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_ip_sets(tokens)?
);
}
"PortSets" => {
builder = builder.set_port_sets(
crate::json_deser::deser_map_com_amazonaws_networkfirewall_port_sets(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",
),
),
}
}