{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.FMS.Types.SecurityGroupRuleDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SecurityGroupRuleDescription = SecurityGroupRuleDescription'
{
SecurityGroupRuleDescription -> Maybe Natural
fromPort :: Prelude.Maybe Prelude.Natural,
SecurityGroupRuleDescription -> Maybe Text
iPV4Range :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Text
iPV6Range :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Text
prefixListId :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Text
protocol :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Natural
toPort :: Prelude.Maybe Prelude.Natural
}
deriving (SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
$c/= :: SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
== :: SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
$c== :: SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
Prelude.Eq, ReadPrec [SecurityGroupRuleDescription]
ReadPrec SecurityGroupRuleDescription
Int -> ReadS SecurityGroupRuleDescription
ReadS [SecurityGroupRuleDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecurityGroupRuleDescription]
$creadListPrec :: ReadPrec [SecurityGroupRuleDescription]
readPrec :: ReadPrec SecurityGroupRuleDescription
$creadPrec :: ReadPrec SecurityGroupRuleDescription
readList :: ReadS [SecurityGroupRuleDescription]
$creadList :: ReadS [SecurityGroupRuleDescription]
readsPrec :: Int -> ReadS SecurityGroupRuleDescription
$creadsPrec :: Int -> ReadS SecurityGroupRuleDescription
Prelude.Read, Int -> SecurityGroupRuleDescription -> ShowS
[SecurityGroupRuleDescription] -> ShowS
SecurityGroupRuleDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecurityGroupRuleDescription] -> ShowS
$cshowList :: [SecurityGroupRuleDescription] -> ShowS
show :: SecurityGroupRuleDescription -> String
$cshow :: SecurityGroupRuleDescription -> String
showsPrec :: Int -> SecurityGroupRuleDescription -> ShowS
$cshowsPrec :: Int -> SecurityGroupRuleDescription -> ShowS
Prelude.Show, forall x.
Rep SecurityGroupRuleDescription x -> SecurityGroupRuleDescription
forall x.
SecurityGroupRuleDescription -> Rep SecurityGroupRuleDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SecurityGroupRuleDescription x -> SecurityGroupRuleDescription
$cfrom :: forall x.
SecurityGroupRuleDescription -> Rep SecurityGroupRuleDescription x
Prelude.Generic)
newSecurityGroupRuleDescription ::
SecurityGroupRuleDescription
newSecurityGroupRuleDescription :: SecurityGroupRuleDescription
newSecurityGroupRuleDescription =
SecurityGroupRuleDescription'
{ $sel:fromPort:SecurityGroupRuleDescription' :: Maybe Natural
fromPort =
forall a. Maybe a
Prelude.Nothing,
$sel:iPV4Range:SecurityGroupRuleDescription' :: Maybe Text
iPV4Range = forall a. Maybe a
Prelude.Nothing,
$sel:iPV6Range:SecurityGroupRuleDescription' :: Maybe Text
iPV6Range = forall a. Maybe a
Prelude.Nothing,
$sel:prefixListId:SecurityGroupRuleDescription' :: Maybe Text
prefixListId = forall a. Maybe a
Prelude.Nothing,
$sel:protocol:SecurityGroupRuleDescription' :: Maybe Text
protocol = forall a. Maybe a
Prelude.Nothing,
$sel:toPort:SecurityGroupRuleDescription' :: Maybe Natural
toPort = forall a. Maybe a
Prelude.Nothing
}
securityGroupRuleDescription_fromPort :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Natural)
securityGroupRuleDescription_fromPort :: Lens' SecurityGroupRuleDescription (Maybe Natural)
securityGroupRuleDescription_fromPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Natural
fromPort :: Maybe Natural
$sel:fromPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
fromPort} -> Maybe Natural
fromPort) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Natural
a -> SecurityGroupRuleDescription
s {$sel:fromPort:SecurityGroupRuleDescription' :: Maybe Natural
fromPort = Maybe Natural
a} :: SecurityGroupRuleDescription)
securityGroupRuleDescription_iPV4Range :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_iPV4Range :: Lens' SecurityGroupRuleDescription (Maybe Text)
securityGroupRuleDescription_iPV4Range = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Text
iPV4Range :: Maybe Text
$sel:iPV4Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
iPV4Range} -> Maybe Text
iPV4Range) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Text
a -> SecurityGroupRuleDescription
s {$sel:iPV4Range:SecurityGroupRuleDescription' :: Maybe Text
iPV4Range = Maybe Text
a} :: SecurityGroupRuleDescription)
securityGroupRuleDescription_iPV6Range :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_iPV6Range :: Lens' SecurityGroupRuleDescription (Maybe Text)
securityGroupRuleDescription_iPV6Range = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Text
iPV6Range :: Maybe Text
$sel:iPV6Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
iPV6Range} -> Maybe Text
iPV6Range) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Text
a -> SecurityGroupRuleDescription
s {$sel:iPV6Range:SecurityGroupRuleDescription' :: Maybe Text
iPV6Range = Maybe Text
a} :: SecurityGroupRuleDescription)
securityGroupRuleDescription_prefixListId :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_prefixListId :: Lens' SecurityGroupRuleDescription (Maybe Text)
securityGroupRuleDescription_prefixListId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Text
prefixListId :: Maybe Text
$sel:prefixListId:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
prefixListId} -> Maybe Text
prefixListId) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Text
a -> SecurityGroupRuleDescription
s {$sel:prefixListId:SecurityGroupRuleDescription' :: Maybe Text
prefixListId = Maybe Text
a} :: SecurityGroupRuleDescription)
securityGroupRuleDescription_protocol :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_protocol :: Lens' SecurityGroupRuleDescription (Maybe Text)
securityGroupRuleDescription_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Text
protocol :: Maybe Text
$sel:protocol:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
protocol} -> Maybe Text
protocol) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Text
a -> SecurityGroupRuleDescription
s {$sel:protocol:SecurityGroupRuleDescription' :: Maybe Text
protocol = Maybe Text
a} :: SecurityGroupRuleDescription)
securityGroupRuleDescription_toPort :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Natural)
securityGroupRuleDescription_toPort :: Lens' SecurityGroupRuleDescription (Maybe Natural)
securityGroupRuleDescription_toPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecurityGroupRuleDescription' {Maybe Natural
toPort :: Maybe Natural
$sel:toPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
toPort} -> Maybe Natural
toPort) (\s :: SecurityGroupRuleDescription
s@SecurityGroupRuleDescription' {} Maybe Natural
a -> SecurityGroupRuleDescription
s {$sel:toPort:SecurityGroupRuleDescription' :: Maybe Natural
toPort = Maybe Natural
a} :: SecurityGroupRuleDescription)
instance Data.FromJSON SecurityGroupRuleDescription where
parseJSON :: Value -> Parser SecurityGroupRuleDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SecurityGroupRuleDescription"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> SecurityGroupRuleDescription
SecurityGroupRuleDescription'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FromPort")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IPV4Range")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IPV6Range")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PrefixListId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Protocol")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ToPort")
)
instance
Prelude.Hashable
SecurityGroupRuleDescription
where
hashWithSalt :: Int -> SecurityGroupRuleDescription -> Int
hashWithSalt Int
_salt SecurityGroupRuleDescription' {Maybe Natural
Maybe Text
toPort :: Maybe Natural
protocol :: Maybe Text
prefixListId :: Maybe Text
iPV6Range :: Maybe Text
iPV4Range :: Maybe Text
fromPort :: Maybe Natural
$sel:toPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
$sel:protocol:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:prefixListId:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:iPV6Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:iPV4Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:fromPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
fromPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iPV4Range
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iPV6Range
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefixListId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
protocol
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
toPort
instance Prelude.NFData SecurityGroupRuleDescription where
rnf :: SecurityGroupRuleDescription -> ()
rnf SecurityGroupRuleDescription' {Maybe Natural
Maybe Text
toPort :: Maybe Natural
protocol :: Maybe Text
prefixListId :: Maybe Text
iPV6Range :: Maybe Text
iPV4Range :: Maybe Text
fromPort :: Maybe Natural
$sel:toPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
$sel:protocol:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:prefixListId:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:iPV6Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:iPV4Range:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Text
$sel:fromPort:SecurityGroupRuleDescription' :: SecurityGroupRuleDescription -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
fromPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iPV4Range
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iPV6Range
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefixListId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
protocol
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
toPort