{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SecurityGroupRuleDescription = SecurityGroupRuleDescription'
{
SecurityGroupRuleDescription -> Maybe Natural
fromPort :: Prelude.Maybe Prelude.Natural,
SecurityGroupRuleDescription -> Maybe Text
protocol :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Text
iPV4Range :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Text
prefixListId :: Prelude.Maybe Prelude.Text,
SecurityGroupRuleDescription -> Maybe Natural
toPort :: Prelude.Maybe Prelude.Natural,
SecurityGroupRuleDescription -> Maybe Text
iPV6Range :: Prelude.Maybe Prelude.Text
}
deriving (SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool
(SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool)
-> (SecurityGroupRuleDescription
-> SecurityGroupRuleDescription -> Bool)
-> Eq SecurityGroupRuleDescription
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]
(Int -> ReadS SecurityGroupRuleDescription)
-> ReadS [SecurityGroupRuleDescription]
-> ReadPrec SecurityGroupRuleDescription
-> ReadPrec [SecurityGroupRuleDescription]
-> Read 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
(Int -> SecurityGroupRuleDescription -> ShowS)
-> (SecurityGroupRuleDescription -> String)
-> ([SecurityGroupRuleDescription] -> ShowS)
-> Show SecurityGroupRuleDescription
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.
SecurityGroupRuleDescription -> Rep SecurityGroupRuleDescription x)
-> (forall x.
Rep SecurityGroupRuleDescription x -> SecurityGroupRuleDescription)
-> Generic SecurityGroupRuleDescription
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' :: Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription
SecurityGroupRuleDescription'
{ $sel:fromPort:SecurityGroupRuleDescription' :: Maybe Natural
fromPort =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:SecurityGroupRuleDescription' :: Maybe Text
protocol = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iPV4Range:SecurityGroupRuleDescription' :: Maybe Text
iPV4Range = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:prefixListId:SecurityGroupRuleDescription' :: Maybe Text
prefixListId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:toPort:SecurityGroupRuleDescription' :: Maybe Natural
toPort = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:iPV6Range:SecurityGroupRuleDescription' :: Maybe Text
iPV6Range = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
securityGroupRuleDescription_fromPort :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Natural)
securityGroupRuleDescription_fromPort :: (Maybe Natural -> f (Maybe Natural))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_fromPort = (SecurityGroupRuleDescription -> Maybe Natural)
-> (SecurityGroupRuleDescription
-> Maybe Natural -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Natural)
(Maybe Natural)
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_protocol :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_protocol :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_protocol = (SecurityGroupRuleDescription -> Maybe Text)
-> (SecurityGroupRuleDescription
-> Maybe Text -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Text)
(Maybe Text)
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_iPV4Range :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_iPV4Range :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_iPV4Range = (SecurityGroupRuleDescription -> Maybe Text)
-> (SecurityGroupRuleDescription
-> Maybe Text -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Text)
(Maybe Text)
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_prefixListId :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_prefixListId :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_prefixListId = (SecurityGroupRuleDescription -> Maybe Text)
-> (SecurityGroupRuleDescription
-> Maybe Text -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Text)
(Maybe Text)
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_toPort :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Natural)
securityGroupRuleDescription_toPort :: (Maybe Natural -> f (Maybe Natural))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_toPort = (SecurityGroupRuleDescription -> Maybe Natural)
-> (SecurityGroupRuleDescription
-> Maybe Natural -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Natural)
(Maybe Natural)
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)
securityGroupRuleDescription_iPV6Range :: Lens.Lens' SecurityGroupRuleDescription (Prelude.Maybe Prelude.Text)
securityGroupRuleDescription_iPV6Range :: (Maybe Text -> f (Maybe Text))
-> SecurityGroupRuleDescription -> f SecurityGroupRuleDescription
securityGroupRuleDescription_iPV6Range = (SecurityGroupRuleDescription -> Maybe Text)
-> (SecurityGroupRuleDescription
-> Maybe Text -> SecurityGroupRuleDescription)
-> Lens
SecurityGroupRuleDescription
SecurityGroupRuleDescription
(Maybe Text)
(Maybe Text)
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)
instance Core.FromJSON SecurityGroupRuleDescription where
parseJSON :: Value -> Parser SecurityGroupRuleDescription
parseJSON =
String
-> (Object -> Parser SecurityGroupRuleDescription)
-> Value
-> Parser SecurityGroupRuleDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SecurityGroupRuleDescription"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription
SecurityGroupRuleDescription'
(Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FromPort")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Protocol")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> SecurityGroupRuleDescription)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Natural -> Maybe Text -> SecurityGroupRuleDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IPV4Range")
Parser
(Maybe Text
-> Maybe Natural -> Maybe Text -> SecurityGroupRuleDescription)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural -> Maybe Text -> SecurityGroupRuleDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PrefixListId")
Parser
(Maybe Natural -> Maybe Text -> SecurityGroupRuleDescription)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> SecurityGroupRuleDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ToPort")
Parser (Maybe Text -> SecurityGroupRuleDescription)
-> Parser (Maybe Text) -> Parser SecurityGroupRuleDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IPV6Range")
)
instance
Prelude.Hashable
SecurityGroupRuleDescription
instance Prelude.NFData SecurityGroupRuleDescription