{-# 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.SecurityHub.Types.AwsWafWebAclDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsWafWebAclRule
data AwsWafWebAclDetails = AwsWafWebAclDetails'
{
AwsWafWebAclDetails -> Maybe [AwsWafWebAclRule]
rules :: Prelude.Maybe [AwsWafWebAclRule],
AwsWafWebAclDetails -> Maybe Text
webAclId :: Prelude.Maybe Prelude.Text,
AwsWafWebAclDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AwsWafWebAclDetails -> Maybe Text
defaultAction :: Prelude.Maybe Prelude.Text
}
deriving (AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool
(AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool)
-> (AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool)
-> Eq AwsWafWebAclDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool
$c/= :: AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool
== :: AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool
$c== :: AwsWafWebAclDetails -> AwsWafWebAclDetails -> Bool
Prelude.Eq, ReadPrec [AwsWafWebAclDetails]
ReadPrec AwsWafWebAclDetails
Int -> ReadS AwsWafWebAclDetails
ReadS [AwsWafWebAclDetails]
(Int -> ReadS AwsWafWebAclDetails)
-> ReadS [AwsWafWebAclDetails]
-> ReadPrec AwsWafWebAclDetails
-> ReadPrec [AwsWafWebAclDetails]
-> Read AwsWafWebAclDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsWafWebAclDetails]
$creadListPrec :: ReadPrec [AwsWafWebAclDetails]
readPrec :: ReadPrec AwsWafWebAclDetails
$creadPrec :: ReadPrec AwsWafWebAclDetails
readList :: ReadS [AwsWafWebAclDetails]
$creadList :: ReadS [AwsWafWebAclDetails]
readsPrec :: Int -> ReadS AwsWafWebAclDetails
$creadsPrec :: Int -> ReadS AwsWafWebAclDetails
Prelude.Read, Int -> AwsWafWebAclDetails -> ShowS
[AwsWafWebAclDetails] -> ShowS
AwsWafWebAclDetails -> String
(Int -> AwsWafWebAclDetails -> ShowS)
-> (AwsWafWebAclDetails -> String)
-> ([AwsWafWebAclDetails] -> ShowS)
-> Show AwsWafWebAclDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsWafWebAclDetails] -> ShowS
$cshowList :: [AwsWafWebAclDetails] -> ShowS
show :: AwsWafWebAclDetails -> String
$cshow :: AwsWafWebAclDetails -> String
showsPrec :: Int -> AwsWafWebAclDetails -> ShowS
$cshowsPrec :: Int -> AwsWafWebAclDetails -> ShowS
Prelude.Show, (forall x. AwsWafWebAclDetails -> Rep AwsWafWebAclDetails x)
-> (forall x. Rep AwsWafWebAclDetails x -> AwsWafWebAclDetails)
-> Generic AwsWafWebAclDetails
forall x. Rep AwsWafWebAclDetails x -> AwsWafWebAclDetails
forall x. AwsWafWebAclDetails -> Rep AwsWafWebAclDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsWafWebAclDetails x -> AwsWafWebAclDetails
$cfrom :: forall x. AwsWafWebAclDetails -> Rep AwsWafWebAclDetails x
Prelude.Generic)
newAwsWafWebAclDetails ::
AwsWafWebAclDetails
newAwsWafWebAclDetails :: AwsWafWebAclDetails
newAwsWafWebAclDetails =
AwsWafWebAclDetails' :: Maybe [AwsWafWebAclRule]
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsWafWebAclDetails
AwsWafWebAclDetails'
{ $sel:rules:AwsWafWebAclDetails' :: Maybe [AwsWafWebAclRule]
rules = Maybe [AwsWafWebAclRule]
forall a. Maybe a
Prelude.Nothing,
$sel:webAclId:AwsWafWebAclDetails' :: Maybe Text
webAclId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:AwsWafWebAclDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultAction:AwsWafWebAclDetails' :: Maybe Text
defaultAction = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsWafWebAclDetails_rules :: Lens.Lens' AwsWafWebAclDetails (Prelude.Maybe [AwsWafWebAclRule])
awsWafWebAclDetails_rules :: (Maybe [AwsWafWebAclRule] -> f (Maybe [AwsWafWebAclRule]))
-> AwsWafWebAclDetails -> f AwsWafWebAclDetails
awsWafWebAclDetails_rules = (AwsWafWebAclDetails -> Maybe [AwsWafWebAclRule])
-> (AwsWafWebAclDetails
-> Maybe [AwsWafWebAclRule] -> AwsWafWebAclDetails)
-> Lens
AwsWafWebAclDetails
AwsWafWebAclDetails
(Maybe [AwsWafWebAclRule])
(Maybe [AwsWafWebAclRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafWebAclDetails' {Maybe [AwsWafWebAclRule]
rules :: Maybe [AwsWafWebAclRule]
$sel:rules:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe [AwsWafWebAclRule]
rules} -> Maybe [AwsWafWebAclRule]
rules) (\s :: AwsWafWebAclDetails
s@AwsWafWebAclDetails' {} Maybe [AwsWafWebAclRule]
a -> AwsWafWebAclDetails
s {$sel:rules:AwsWafWebAclDetails' :: Maybe [AwsWafWebAclRule]
rules = Maybe [AwsWafWebAclRule]
a} :: AwsWafWebAclDetails) ((Maybe [AwsWafWebAclRule] -> f (Maybe [AwsWafWebAclRule]))
-> AwsWafWebAclDetails -> f AwsWafWebAclDetails)
-> ((Maybe [AwsWafWebAclRule] -> f (Maybe [AwsWafWebAclRule]))
-> Maybe [AwsWafWebAclRule] -> f (Maybe [AwsWafWebAclRule]))
-> (Maybe [AwsWafWebAclRule] -> f (Maybe [AwsWafWebAclRule]))
-> AwsWafWebAclDetails
-> f AwsWafWebAclDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AwsWafWebAclRule]
[AwsWafWebAclRule]
[AwsWafWebAclRule]
[AwsWafWebAclRule]
-> Iso
(Maybe [AwsWafWebAclRule])
(Maybe [AwsWafWebAclRule])
(Maybe [AwsWafWebAclRule])
(Maybe [AwsWafWebAclRule])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AwsWafWebAclRule]
[AwsWafWebAclRule]
[AwsWafWebAclRule]
[AwsWafWebAclRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
awsWafWebAclDetails_webAclId :: Lens.Lens' AwsWafWebAclDetails (Prelude.Maybe Prelude.Text)
awsWafWebAclDetails_webAclId :: (Maybe Text -> f (Maybe Text))
-> AwsWafWebAclDetails -> f AwsWafWebAclDetails
awsWafWebAclDetails_webAclId = (AwsWafWebAclDetails -> Maybe Text)
-> (AwsWafWebAclDetails -> Maybe Text -> AwsWafWebAclDetails)
-> Lens
AwsWafWebAclDetails AwsWafWebAclDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafWebAclDetails' {Maybe Text
webAclId :: Maybe Text
$sel:webAclId:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
webAclId} -> Maybe Text
webAclId) (\s :: AwsWafWebAclDetails
s@AwsWafWebAclDetails' {} Maybe Text
a -> AwsWafWebAclDetails
s {$sel:webAclId:AwsWafWebAclDetails' :: Maybe Text
webAclId = Maybe Text
a} :: AwsWafWebAclDetails)
awsWafWebAclDetails_name :: Lens.Lens' AwsWafWebAclDetails (Prelude.Maybe Prelude.Text)
awsWafWebAclDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsWafWebAclDetails -> f AwsWafWebAclDetails
awsWafWebAclDetails_name = (AwsWafWebAclDetails -> Maybe Text)
-> (AwsWafWebAclDetails -> Maybe Text -> AwsWafWebAclDetails)
-> Lens
AwsWafWebAclDetails AwsWafWebAclDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafWebAclDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsWafWebAclDetails
s@AwsWafWebAclDetails' {} Maybe Text
a -> AwsWafWebAclDetails
s {$sel:name:AwsWafWebAclDetails' :: Maybe Text
name = Maybe Text
a} :: AwsWafWebAclDetails)
awsWafWebAclDetails_defaultAction :: Lens.Lens' AwsWafWebAclDetails (Prelude.Maybe Prelude.Text)
awsWafWebAclDetails_defaultAction :: (Maybe Text -> f (Maybe Text))
-> AwsWafWebAclDetails -> f AwsWafWebAclDetails
awsWafWebAclDetails_defaultAction = (AwsWafWebAclDetails -> Maybe Text)
-> (AwsWafWebAclDetails -> Maybe Text -> AwsWafWebAclDetails)
-> Lens
AwsWafWebAclDetails AwsWafWebAclDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafWebAclDetails' {Maybe Text
defaultAction :: Maybe Text
$sel:defaultAction:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
defaultAction} -> Maybe Text
defaultAction) (\s :: AwsWafWebAclDetails
s@AwsWafWebAclDetails' {} Maybe Text
a -> AwsWafWebAclDetails
s {$sel:defaultAction:AwsWafWebAclDetails' :: Maybe Text
defaultAction = Maybe Text
a} :: AwsWafWebAclDetails)
instance Core.FromJSON AwsWafWebAclDetails where
parseJSON :: Value -> Parser AwsWafWebAclDetails
parseJSON =
String
-> (Object -> Parser AwsWafWebAclDetails)
-> Value
-> Parser AwsWafWebAclDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsWafWebAclDetails"
( \Object
x ->
Maybe [AwsWafWebAclRule]
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsWafWebAclDetails
AwsWafWebAclDetails'
(Maybe [AwsWafWebAclRule]
-> Maybe Text -> Maybe Text -> Maybe Text -> AwsWafWebAclDetails)
-> Parser (Maybe [AwsWafWebAclRule])
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AwsWafWebAclDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [AwsWafWebAclRule]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Rules" Parser (Maybe (Maybe [AwsWafWebAclRule]))
-> Maybe [AwsWafWebAclRule] -> Parser (Maybe [AwsWafWebAclRule])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsWafWebAclRule]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AwsWafWebAclDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AwsWafWebAclDetails)
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
"WebAclId")
Parser (Maybe Text -> Maybe Text -> AwsWafWebAclDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsWafWebAclDetails)
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
"Name")
Parser (Maybe Text -> AwsWafWebAclDetails)
-> Parser (Maybe Text) -> Parser AwsWafWebAclDetails
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
"DefaultAction")
)
instance Prelude.Hashable AwsWafWebAclDetails
instance Prelude.NFData AwsWafWebAclDetails
instance Core.ToJSON AwsWafWebAclDetails where
toJSON :: AwsWafWebAclDetails -> Value
toJSON AwsWafWebAclDetails' {Maybe [AwsWafWebAclRule]
Maybe Text
defaultAction :: Maybe Text
name :: Maybe Text
webAclId :: Maybe Text
rules :: Maybe [AwsWafWebAclRule]
$sel:defaultAction:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
$sel:name:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
$sel:webAclId:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe Text
$sel:rules:AwsWafWebAclDetails' :: AwsWafWebAclDetails -> Maybe [AwsWafWebAclRule]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Rules" Text -> [AwsWafWebAclRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AwsWafWebAclRule] -> Pair)
-> Maybe [AwsWafWebAclRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsWafWebAclRule]
rules,
(Text
"WebAclId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
webAclId,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"DefaultAction" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultAction
]
)