{-# 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.WAF.Types.XssMatchSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAF.Types.XssMatchTuple
data XssMatchSet = XssMatchSet'
{
XssMatchSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
XssMatchSet -> Text
xssMatchSetId :: Prelude.Text,
XssMatchSet -> [XssMatchTuple]
xssMatchTuples :: [XssMatchTuple]
}
deriving (XssMatchSet -> XssMatchSet -> Bool
(XssMatchSet -> XssMatchSet -> Bool)
-> (XssMatchSet -> XssMatchSet -> Bool) -> Eq XssMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XssMatchSet -> XssMatchSet -> Bool
$c/= :: XssMatchSet -> XssMatchSet -> Bool
== :: XssMatchSet -> XssMatchSet -> Bool
$c== :: XssMatchSet -> XssMatchSet -> Bool
Prelude.Eq, ReadPrec [XssMatchSet]
ReadPrec XssMatchSet
Int -> ReadS XssMatchSet
ReadS [XssMatchSet]
(Int -> ReadS XssMatchSet)
-> ReadS [XssMatchSet]
-> ReadPrec XssMatchSet
-> ReadPrec [XssMatchSet]
-> Read XssMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [XssMatchSet]
$creadListPrec :: ReadPrec [XssMatchSet]
readPrec :: ReadPrec XssMatchSet
$creadPrec :: ReadPrec XssMatchSet
readList :: ReadS [XssMatchSet]
$creadList :: ReadS [XssMatchSet]
readsPrec :: Int -> ReadS XssMatchSet
$creadsPrec :: Int -> ReadS XssMatchSet
Prelude.Read, Int -> XssMatchSet -> ShowS
[XssMatchSet] -> ShowS
XssMatchSet -> String
(Int -> XssMatchSet -> ShowS)
-> (XssMatchSet -> String)
-> ([XssMatchSet] -> ShowS)
-> Show XssMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [XssMatchSet] -> ShowS
$cshowList :: [XssMatchSet] -> ShowS
show :: XssMatchSet -> String
$cshow :: XssMatchSet -> String
showsPrec :: Int -> XssMatchSet -> ShowS
$cshowsPrec :: Int -> XssMatchSet -> ShowS
Prelude.Show, (forall x. XssMatchSet -> Rep XssMatchSet x)
-> (forall x. Rep XssMatchSet x -> XssMatchSet)
-> Generic XssMatchSet
forall x. Rep XssMatchSet x -> XssMatchSet
forall x. XssMatchSet -> Rep XssMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep XssMatchSet x -> XssMatchSet
$cfrom :: forall x. XssMatchSet -> Rep XssMatchSet x
Prelude.Generic)
newXssMatchSet ::
Prelude.Text ->
XssMatchSet
newXssMatchSet :: Text -> XssMatchSet
newXssMatchSet Text
pXssMatchSetId_ =
XssMatchSet' :: Maybe Text -> Text -> [XssMatchTuple] -> XssMatchSet
XssMatchSet'
{ $sel:name:XssMatchSet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:xssMatchSetId:XssMatchSet' :: Text
xssMatchSetId = Text
pXssMatchSetId_,
$sel:xssMatchTuples:XssMatchSet' :: [XssMatchTuple]
xssMatchTuples = [XssMatchTuple]
forall a. Monoid a => a
Prelude.mempty
}
xssMatchSet_name :: Lens.Lens' XssMatchSet (Prelude.Maybe Prelude.Text)
xssMatchSet_name :: (Maybe Text -> f (Maybe Text)) -> XssMatchSet -> f XssMatchSet
xssMatchSet_name = (XssMatchSet -> Maybe Text)
-> (XssMatchSet -> Maybe Text -> XssMatchSet)
-> Lens XssMatchSet XssMatchSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XssMatchSet' {Maybe Text
name :: Maybe Text
$sel:name:XssMatchSet' :: XssMatchSet -> Maybe Text
name} -> Maybe Text
name) (\s :: XssMatchSet
s@XssMatchSet' {} Maybe Text
a -> XssMatchSet
s {$sel:name:XssMatchSet' :: Maybe Text
name = Maybe Text
a} :: XssMatchSet)
xssMatchSet_xssMatchSetId :: Lens.Lens' XssMatchSet Prelude.Text
xssMatchSet_xssMatchSetId :: (Text -> f Text) -> XssMatchSet -> f XssMatchSet
xssMatchSet_xssMatchSetId = (XssMatchSet -> Text)
-> (XssMatchSet -> Text -> XssMatchSet)
-> Lens XssMatchSet XssMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XssMatchSet' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:XssMatchSet' :: XssMatchSet -> Text
xssMatchSetId} -> Text
xssMatchSetId) (\s :: XssMatchSet
s@XssMatchSet' {} Text
a -> XssMatchSet
s {$sel:xssMatchSetId:XssMatchSet' :: Text
xssMatchSetId = Text
a} :: XssMatchSet)
xssMatchSet_xssMatchTuples :: Lens.Lens' XssMatchSet [XssMatchTuple]
xssMatchSet_xssMatchTuples :: ([XssMatchTuple] -> f [XssMatchTuple])
-> XssMatchSet -> f XssMatchSet
xssMatchSet_xssMatchTuples = (XssMatchSet -> [XssMatchTuple])
-> (XssMatchSet -> [XssMatchTuple] -> XssMatchSet)
-> Lens XssMatchSet XssMatchSet [XssMatchTuple] [XssMatchTuple]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XssMatchSet' {[XssMatchTuple]
xssMatchTuples :: [XssMatchTuple]
$sel:xssMatchTuples:XssMatchSet' :: XssMatchSet -> [XssMatchTuple]
xssMatchTuples} -> [XssMatchTuple]
xssMatchTuples) (\s :: XssMatchSet
s@XssMatchSet' {} [XssMatchTuple]
a -> XssMatchSet
s {$sel:xssMatchTuples:XssMatchSet' :: [XssMatchTuple]
xssMatchTuples = [XssMatchTuple]
a} :: XssMatchSet) (([XssMatchTuple] -> f [XssMatchTuple])
-> XssMatchSet -> f XssMatchSet)
-> (([XssMatchTuple] -> f [XssMatchTuple])
-> [XssMatchTuple] -> f [XssMatchTuple])
-> ([XssMatchTuple] -> f [XssMatchTuple])
-> XssMatchSet
-> f XssMatchSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([XssMatchTuple] -> f [XssMatchTuple])
-> [XssMatchTuple] -> f [XssMatchTuple]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON XssMatchSet where
parseJSON :: Value -> Parser XssMatchSet
parseJSON =
String
-> (Object -> Parser XssMatchSet) -> Value -> Parser XssMatchSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"XssMatchSet"
( \Object
x ->
Maybe Text -> Text -> [XssMatchTuple] -> XssMatchSet
XssMatchSet'
(Maybe Text -> Text -> [XssMatchTuple] -> XssMatchSet)
-> Parser (Maybe Text)
-> Parser (Text -> [XssMatchTuple] -> XssMatchSet)
forall (f :: * -> *) a b. Functor 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 (Text -> [XssMatchTuple] -> XssMatchSet)
-> Parser Text -> Parser ([XssMatchTuple] -> XssMatchSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"XssMatchSetId")
Parser ([XssMatchTuple] -> XssMatchSet)
-> Parser [XssMatchTuple] -> Parser XssMatchSet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [XssMatchTuple])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"XssMatchTuples"
Parser (Maybe [XssMatchTuple])
-> [XssMatchTuple] -> Parser [XssMatchTuple]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [XssMatchTuple]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable XssMatchSet
instance Prelude.NFData XssMatchSet