{-# 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.EC2.Types.AnalysisAclRule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.PortRange
import qualified Amazonka.Prelude as Prelude
data AnalysisAclRule = AnalysisAclRule'
{
AnalysisAclRule -> Maybe Text
cidr :: Prelude.Maybe Prelude.Text,
AnalysisAclRule -> Maybe Bool
egress :: Prelude.Maybe Prelude.Bool,
AnalysisAclRule -> Maybe PortRange
portRange :: Prelude.Maybe PortRange,
AnalysisAclRule -> Maybe Text
protocol :: Prelude.Maybe Prelude.Text,
AnalysisAclRule -> Maybe Text
ruleAction :: Prelude.Maybe Prelude.Text,
AnalysisAclRule -> Maybe Int
ruleNumber :: Prelude.Maybe Prelude.Int
}
deriving (AnalysisAclRule -> AnalysisAclRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisAclRule -> AnalysisAclRule -> Bool
$c/= :: AnalysisAclRule -> AnalysisAclRule -> Bool
== :: AnalysisAclRule -> AnalysisAclRule -> Bool
$c== :: AnalysisAclRule -> AnalysisAclRule -> Bool
Prelude.Eq, ReadPrec [AnalysisAclRule]
ReadPrec AnalysisAclRule
Int -> ReadS AnalysisAclRule
ReadS [AnalysisAclRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisAclRule]
$creadListPrec :: ReadPrec [AnalysisAclRule]
readPrec :: ReadPrec AnalysisAclRule
$creadPrec :: ReadPrec AnalysisAclRule
readList :: ReadS [AnalysisAclRule]
$creadList :: ReadS [AnalysisAclRule]
readsPrec :: Int -> ReadS AnalysisAclRule
$creadsPrec :: Int -> ReadS AnalysisAclRule
Prelude.Read, Int -> AnalysisAclRule -> ShowS
[AnalysisAclRule] -> ShowS
AnalysisAclRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisAclRule] -> ShowS
$cshowList :: [AnalysisAclRule] -> ShowS
show :: AnalysisAclRule -> String
$cshow :: AnalysisAclRule -> String
showsPrec :: Int -> AnalysisAclRule -> ShowS
$cshowsPrec :: Int -> AnalysisAclRule -> ShowS
Prelude.Show, forall x. Rep AnalysisAclRule x -> AnalysisAclRule
forall x. AnalysisAclRule -> Rep AnalysisAclRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalysisAclRule x -> AnalysisAclRule
$cfrom :: forall x. AnalysisAclRule -> Rep AnalysisAclRule x
Prelude.Generic)
newAnalysisAclRule ::
AnalysisAclRule
newAnalysisAclRule :: AnalysisAclRule
newAnalysisAclRule =
AnalysisAclRule'
{ $sel:cidr:AnalysisAclRule' :: Maybe Text
cidr = forall a. Maybe a
Prelude.Nothing,
$sel:egress:AnalysisAclRule' :: Maybe Bool
egress = forall a. Maybe a
Prelude.Nothing,
$sel:portRange:AnalysisAclRule' :: Maybe PortRange
portRange = forall a. Maybe a
Prelude.Nothing,
$sel:protocol:AnalysisAclRule' :: Maybe Text
protocol = forall a. Maybe a
Prelude.Nothing,
$sel:ruleAction:AnalysisAclRule' :: Maybe Text
ruleAction = forall a. Maybe a
Prelude.Nothing,
$sel:ruleNumber:AnalysisAclRule' :: Maybe Int
ruleNumber = forall a. Maybe a
Prelude.Nothing
}
analysisAclRule_cidr :: Lens.Lens' AnalysisAclRule (Prelude.Maybe Prelude.Text)
analysisAclRule_cidr :: Lens' AnalysisAclRule (Maybe Text)
analysisAclRule_cidr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe Text
cidr :: Maybe Text
$sel:cidr:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
cidr} -> Maybe Text
cidr) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe Text
a -> AnalysisAclRule
s {$sel:cidr:AnalysisAclRule' :: Maybe Text
cidr = Maybe Text
a} :: AnalysisAclRule)
analysisAclRule_egress :: Lens.Lens' AnalysisAclRule (Prelude.Maybe Prelude.Bool)
analysisAclRule_egress :: Lens' AnalysisAclRule (Maybe Bool)
analysisAclRule_egress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe Bool
egress :: Maybe Bool
$sel:egress:AnalysisAclRule' :: AnalysisAclRule -> Maybe Bool
egress} -> Maybe Bool
egress) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe Bool
a -> AnalysisAclRule
s {$sel:egress:AnalysisAclRule' :: Maybe Bool
egress = Maybe Bool
a} :: AnalysisAclRule)
analysisAclRule_portRange :: Lens.Lens' AnalysisAclRule (Prelude.Maybe PortRange)
analysisAclRule_portRange :: Lens' AnalysisAclRule (Maybe PortRange)
analysisAclRule_portRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe PortRange
portRange :: Maybe PortRange
$sel:portRange:AnalysisAclRule' :: AnalysisAclRule -> Maybe PortRange
portRange} -> Maybe PortRange
portRange) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe PortRange
a -> AnalysisAclRule
s {$sel:portRange:AnalysisAclRule' :: Maybe PortRange
portRange = Maybe PortRange
a} :: AnalysisAclRule)
analysisAclRule_protocol :: Lens.Lens' AnalysisAclRule (Prelude.Maybe Prelude.Text)
analysisAclRule_protocol :: Lens' AnalysisAclRule (Maybe Text)
analysisAclRule_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe Text
protocol :: Maybe Text
$sel:protocol:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
protocol} -> Maybe Text
protocol) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe Text
a -> AnalysisAclRule
s {$sel:protocol:AnalysisAclRule' :: Maybe Text
protocol = Maybe Text
a} :: AnalysisAclRule)
analysisAclRule_ruleAction :: Lens.Lens' AnalysisAclRule (Prelude.Maybe Prelude.Text)
analysisAclRule_ruleAction :: Lens' AnalysisAclRule (Maybe Text)
analysisAclRule_ruleAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe Text
ruleAction :: Maybe Text
$sel:ruleAction:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
ruleAction} -> Maybe Text
ruleAction) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe Text
a -> AnalysisAclRule
s {$sel:ruleAction:AnalysisAclRule' :: Maybe Text
ruleAction = Maybe Text
a} :: AnalysisAclRule)
analysisAclRule_ruleNumber :: Lens.Lens' AnalysisAclRule (Prelude.Maybe Prelude.Int)
analysisAclRule_ruleNumber :: Lens' AnalysisAclRule (Maybe Int)
analysisAclRule_ruleNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisAclRule' {Maybe Int
ruleNumber :: Maybe Int
$sel:ruleNumber:AnalysisAclRule' :: AnalysisAclRule -> Maybe Int
ruleNumber} -> Maybe Int
ruleNumber) (\s :: AnalysisAclRule
s@AnalysisAclRule' {} Maybe Int
a -> AnalysisAclRule
s {$sel:ruleNumber:AnalysisAclRule' :: Maybe Int
ruleNumber = Maybe Int
a} :: AnalysisAclRule)
instance Data.FromXML AnalysisAclRule where
parseXML :: [Node] -> Either String AnalysisAclRule
parseXML [Node]
x =
Maybe Text
-> Maybe Bool
-> Maybe PortRange
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AnalysisAclRule
AnalysisAclRule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"cidr")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"egress")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"portRange")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"protocol")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ruleAction")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ruleNumber")
instance Prelude.Hashable AnalysisAclRule where
hashWithSalt :: Int -> AnalysisAclRule -> Int
hashWithSalt Int
_salt AnalysisAclRule' {Maybe Bool
Maybe Int
Maybe Text
Maybe PortRange
ruleNumber :: Maybe Int
ruleAction :: Maybe Text
protocol :: Maybe Text
portRange :: Maybe PortRange
egress :: Maybe Bool
cidr :: Maybe Text
$sel:ruleNumber:AnalysisAclRule' :: AnalysisAclRule -> Maybe Int
$sel:ruleAction:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
$sel:protocol:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
$sel:portRange:AnalysisAclRule' :: AnalysisAclRule -> Maybe PortRange
$sel:egress:AnalysisAclRule' :: AnalysisAclRule -> Maybe Bool
$sel:cidr:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cidr
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
egress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PortRange
portRange
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
protocol
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleAction
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
ruleNumber
instance Prelude.NFData AnalysisAclRule where
rnf :: AnalysisAclRule -> ()
rnf AnalysisAclRule' {Maybe Bool
Maybe Int
Maybe Text
Maybe PortRange
ruleNumber :: Maybe Int
ruleAction :: Maybe Text
protocol :: Maybe Text
portRange :: Maybe PortRange
egress :: Maybe Bool
cidr :: Maybe Text
$sel:ruleNumber:AnalysisAclRule' :: AnalysisAclRule -> Maybe Int
$sel:ruleAction:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
$sel:protocol:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
$sel:portRange:AnalysisAclRule' :: AnalysisAclRule -> Maybe PortRange
$sel:egress:AnalysisAclRule' :: AnalysisAclRule -> Maybe Bool
$sel:cidr:AnalysisAclRule' :: AnalysisAclRule -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cidr
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
egress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PortRange
portRange
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 Text
ruleAction
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
ruleNumber