pub struct Builder { /* private fields */ }
Expand description
A builder for AwsEc2SecurityGroupIpPermission
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn ip_protocol(self, input: impl Into<String>) -> Self
pub fn ip_protocol(self, input: impl Into<String>) -> Self
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number.
[VPC only] Use -1
to specify all protocols.
When authorizing security group rules, specifying -1
or a protocol number other than tcp
, udp
, icmp
, or icmpv6
allows traffic on all ports, regardless of any port range you specify.
For tcp
, udp
, and icmp
, you must specify a port range.
For icmpv6
, the port range is optional. If you omit the port range, traffic for all types and codes is allowed.
sourcepub fn set_ip_protocol(self, input: Option<String>) -> Self
pub fn set_ip_protocol(self, input: Option<String>) -> Self
The IP protocol name (tcp
, udp
, icmp
, icmpv6
) or number.
[VPC only] Use -1
to specify all protocols.
When authorizing security group rules, specifying -1
or a protocol number other than tcp
, udp
, icmp
, or icmpv6
allows traffic on all ports, regardless of any port range you specify.
For tcp
, udp
, and icmp
, you must specify a port range.
For icmpv6
, the port range is optional. If you omit the port range, traffic for all types and codes is allowed.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 from_port(self, input: i32) -> Self
pub fn from_port(self, input: i32) -> Self
The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
sourcepub fn set_from_port(self, input: Option<i32>) -> Self
pub fn set_from_port(self, input: Option<i32>) -> Self
The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 type number.
A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 types, you must specify all codes.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 to_port(self, input: i32) -> Self
pub fn to_port(self, input: i32) -> Self
The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
sourcepub fn set_to_port(self, input: Option<i32>) -> Self
pub fn set_to_port(self, input: Option<i32>) -> Self
The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
A value of -1
indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 types, you must specify all codes.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 user_id_group_pairs(
self,
input: AwsEc2SecurityGroupUserIdGroupPair
) -> Self
pub fn user_id_group_pairs(
self,
input: AwsEc2SecurityGroupUserIdGroupPair
) -> Self
Appends an item to user_id_group_pairs
.
To override the contents of this collection use set_user_id_group_pairs
.
The security group and Amazon Web Services account ID pairs.
sourcepub fn set_user_id_group_pairs(
self,
input: Option<Vec<AwsEc2SecurityGroupUserIdGroupPair>>
) -> Self
pub fn set_user_id_group_pairs(
self,
input: Option<Vec<AwsEc2SecurityGroupUserIdGroupPair>>
) -> Self
The security group and Amazon Web Services account ID pairs.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 ip_ranges(self, input: AwsEc2SecurityGroupIpRange) -> Self
pub fn ip_ranges(self, input: AwsEc2SecurityGroupIpRange) -> Self
Appends an item to ip_ranges
.
To override the contents of this collection use set_ip_ranges
.
The IPv4 ranges.
sourcepub fn set_ip_ranges(
self,
input: Option<Vec<AwsEc2SecurityGroupIpRange>>
) -> Self
pub fn set_ip_ranges(
self,
input: Option<Vec<AwsEc2SecurityGroupIpRange>>
) -> Self
The IPv4 ranges.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 ipv6_ranges(self, input: AwsEc2SecurityGroupIpv6Range) -> Self
pub fn ipv6_ranges(self, input: AwsEc2SecurityGroupIpv6Range) -> Self
Appends an item to ipv6_ranges
.
To override the contents of this collection use set_ipv6_ranges
.
The IPv6 ranges.
sourcepub fn set_ipv6_ranges(
self,
input: Option<Vec<AwsEc2SecurityGroupIpv6Range>>
) -> Self
pub fn set_ipv6_ranges(
self,
input: Option<Vec<AwsEc2SecurityGroupIpv6Range>>
) -> Self
The IPv6 ranges.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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 prefix_list_ids(self, input: AwsEc2SecurityGroupPrefixListId) -> Self
pub fn prefix_list_ids(self, input: AwsEc2SecurityGroupPrefixListId) -> Self
Appends an item to prefix_list_ids
.
To override the contents of this collection use set_prefix_list_ids
.
[VPC only] The prefix list IDs for an Amazon Web Services service. With outbound rules, this is the Amazon Web Services service to access through a VPC endpoint from instances associated with the security group.
sourcepub fn set_prefix_list_ids(
self,
input: Option<Vec<AwsEc2SecurityGroupPrefixListId>>
) -> Self
pub fn set_prefix_list_ids(
self,
input: Option<Vec<AwsEc2SecurityGroupPrefixListId>>
) -> Self
[VPC only] The prefix list IDs for an Amazon Web Services service. With outbound rules, this is the Amazon Web Services service to access through a VPC endpoint from instances associated with the security group.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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) -> AwsEc2SecurityGroupIpPermission
pub fn build(self) -> AwsEc2SecurityGroupIpPermission
Consumes the builder and constructs a AwsEc2SecurityGroupIpPermission
.
Examples found in repository?
33934 33935 33936 33937 33938 33939 33940 33941 33942 33943 33944 33945 33946 33947 33948 33949 33950 33951 33952 33953 33954 33955 33956 33957 33958 33959 33960 33961 33962 33963 33964 33965 33966 33967 33968 33969 33970 33971 33972 33973 33974 33975 33976 33977 33978 33979 33980 33981 33982 33983 33984 33985 33986 33987 33988 33989 33990 33991 33992 33993 33994 33995 33996 33997 33998 33999 34000 34001 34002 34003 34004 34005 34006 34007 34008 34009 34010 34011 34012 34013 34014 34015 34016 34017 34018 34019 34020 34021 34022 34023 34024 34025 34026 34027
pub(crate) fn deser_structure_crate_model_aws_ec2_security_group_ip_permission<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AwsEc2SecurityGroupIpPermission>,
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::aws_ec2_security_group_ip_permission::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() {
"IpProtocol" => {
builder = builder.set_ip_protocol(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"FromPort" => {
builder = builder.set_from_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"ToPort" => {
builder = builder.set_to_port(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"UserIdGroupPairs" => {
builder = builder.set_user_id_group_pairs(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_user_id_group_pair_list(tokens)?
);
}
"IpRanges" => {
builder = builder.set_ip_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ip_range_list(tokens)?
);
}
"Ipv6Ranges" => {
builder = builder.set_ipv6_ranges(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_ipv6_range_list(tokens)?
);
}
"PrefixListIds" => {
builder = builder.set_prefix_list_ids(
crate::json_deser::deser_list_com_amazonaws_securityhub_aws_ec2_security_group_prefix_list_id_list(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",
),
),
}
}