{-# 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.WAFRegional.Types.RegexMatchSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAFRegional.Types.RegexMatchTuple
data RegexMatchSet = RegexMatchSet'
{
RegexMatchSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
RegexMatchSet -> Maybe [RegexMatchTuple]
regexMatchTuples :: Prelude.Maybe [RegexMatchTuple],
RegexMatchSet -> Maybe Text
regexMatchSetId :: Prelude.Maybe Prelude.Text
}
deriving (RegexMatchSet -> RegexMatchSet -> Bool
(RegexMatchSet -> RegexMatchSet -> Bool)
-> (RegexMatchSet -> RegexMatchSet -> Bool) -> Eq RegexMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegexMatchSet -> RegexMatchSet -> Bool
$c/= :: RegexMatchSet -> RegexMatchSet -> Bool
== :: RegexMatchSet -> RegexMatchSet -> Bool
$c== :: RegexMatchSet -> RegexMatchSet -> Bool
Prelude.Eq, ReadPrec [RegexMatchSet]
ReadPrec RegexMatchSet
Int -> ReadS RegexMatchSet
ReadS [RegexMatchSet]
(Int -> ReadS RegexMatchSet)
-> ReadS [RegexMatchSet]
-> ReadPrec RegexMatchSet
-> ReadPrec [RegexMatchSet]
-> Read RegexMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegexMatchSet]
$creadListPrec :: ReadPrec [RegexMatchSet]
readPrec :: ReadPrec RegexMatchSet
$creadPrec :: ReadPrec RegexMatchSet
readList :: ReadS [RegexMatchSet]
$creadList :: ReadS [RegexMatchSet]
readsPrec :: Int -> ReadS RegexMatchSet
$creadsPrec :: Int -> ReadS RegexMatchSet
Prelude.Read, Int -> RegexMatchSet -> ShowS
[RegexMatchSet] -> ShowS
RegexMatchSet -> String
(Int -> RegexMatchSet -> ShowS)
-> (RegexMatchSet -> String)
-> ([RegexMatchSet] -> ShowS)
-> Show RegexMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegexMatchSet] -> ShowS
$cshowList :: [RegexMatchSet] -> ShowS
show :: RegexMatchSet -> String
$cshow :: RegexMatchSet -> String
showsPrec :: Int -> RegexMatchSet -> ShowS
$cshowsPrec :: Int -> RegexMatchSet -> ShowS
Prelude.Show, (forall x. RegexMatchSet -> Rep RegexMatchSet x)
-> (forall x. Rep RegexMatchSet x -> RegexMatchSet)
-> Generic RegexMatchSet
forall x. Rep RegexMatchSet x -> RegexMatchSet
forall x. RegexMatchSet -> Rep RegexMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegexMatchSet x -> RegexMatchSet
$cfrom :: forall x. RegexMatchSet -> Rep RegexMatchSet x
Prelude.Generic)
newRegexMatchSet ::
RegexMatchSet
newRegexMatchSet :: RegexMatchSet
newRegexMatchSet =
RegexMatchSet' :: Maybe Text
-> Maybe [RegexMatchTuple] -> Maybe Text -> RegexMatchSet
RegexMatchSet'
{ $sel:name:RegexMatchSet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:regexMatchTuples:RegexMatchSet' :: Maybe [RegexMatchTuple]
regexMatchTuples = Maybe [RegexMatchTuple]
forall a. Maybe a
Prelude.Nothing,
$sel:regexMatchSetId:RegexMatchSet' :: Maybe Text
regexMatchSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
regexMatchSet_name :: Lens.Lens' RegexMatchSet (Prelude.Maybe Prelude.Text)
regexMatchSet_name :: (Maybe Text -> f (Maybe Text)) -> RegexMatchSet -> f RegexMatchSet
regexMatchSet_name = (RegexMatchSet -> Maybe Text)
-> (RegexMatchSet -> Maybe Text -> RegexMatchSet)
-> Lens RegexMatchSet RegexMatchSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexMatchSet' {Maybe Text
name :: Maybe Text
$sel:name:RegexMatchSet' :: RegexMatchSet -> Maybe Text
name} -> Maybe Text
name) (\s :: RegexMatchSet
s@RegexMatchSet' {} Maybe Text
a -> RegexMatchSet
s {$sel:name:RegexMatchSet' :: Maybe Text
name = Maybe Text
a} :: RegexMatchSet)
regexMatchSet_regexMatchTuples :: Lens.Lens' RegexMatchSet (Prelude.Maybe [RegexMatchTuple])
regexMatchSet_regexMatchTuples :: (Maybe [RegexMatchTuple] -> f (Maybe [RegexMatchTuple]))
-> RegexMatchSet -> f RegexMatchSet
regexMatchSet_regexMatchTuples = (RegexMatchSet -> Maybe [RegexMatchTuple])
-> (RegexMatchSet -> Maybe [RegexMatchTuple] -> RegexMatchSet)
-> Lens
RegexMatchSet
RegexMatchSet
(Maybe [RegexMatchTuple])
(Maybe [RegexMatchTuple])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexMatchSet' {Maybe [RegexMatchTuple]
regexMatchTuples :: Maybe [RegexMatchTuple]
$sel:regexMatchTuples:RegexMatchSet' :: RegexMatchSet -> Maybe [RegexMatchTuple]
regexMatchTuples} -> Maybe [RegexMatchTuple]
regexMatchTuples) (\s :: RegexMatchSet
s@RegexMatchSet' {} Maybe [RegexMatchTuple]
a -> RegexMatchSet
s {$sel:regexMatchTuples:RegexMatchSet' :: Maybe [RegexMatchTuple]
regexMatchTuples = Maybe [RegexMatchTuple]
a} :: RegexMatchSet) ((Maybe [RegexMatchTuple] -> f (Maybe [RegexMatchTuple]))
-> RegexMatchSet -> f RegexMatchSet)
-> ((Maybe [RegexMatchTuple] -> f (Maybe [RegexMatchTuple]))
-> Maybe [RegexMatchTuple] -> f (Maybe [RegexMatchTuple]))
-> (Maybe [RegexMatchTuple] -> f (Maybe [RegexMatchTuple]))
-> RegexMatchSet
-> f RegexMatchSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RegexMatchTuple]
[RegexMatchTuple]
[RegexMatchTuple]
[RegexMatchTuple]
-> Iso
(Maybe [RegexMatchTuple])
(Maybe [RegexMatchTuple])
(Maybe [RegexMatchTuple])
(Maybe [RegexMatchTuple])
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
[RegexMatchTuple]
[RegexMatchTuple]
[RegexMatchTuple]
[RegexMatchTuple]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
regexMatchSet_regexMatchSetId :: Lens.Lens' RegexMatchSet (Prelude.Maybe Prelude.Text)
regexMatchSet_regexMatchSetId :: (Maybe Text -> f (Maybe Text)) -> RegexMatchSet -> f RegexMatchSet
regexMatchSet_regexMatchSetId = (RegexMatchSet -> Maybe Text)
-> (RegexMatchSet -> Maybe Text -> RegexMatchSet)
-> Lens RegexMatchSet RegexMatchSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexMatchSet' {Maybe Text
regexMatchSetId :: Maybe Text
$sel:regexMatchSetId:RegexMatchSet' :: RegexMatchSet -> Maybe Text
regexMatchSetId} -> Maybe Text
regexMatchSetId) (\s :: RegexMatchSet
s@RegexMatchSet' {} Maybe Text
a -> RegexMatchSet
s {$sel:regexMatchSetId:RegexMatchSet' :: Maybe Text
regexMatchSetId = Maybe Text
a} :: RegexMatchSet)
instance Core.FromJSON RegexMatchSet where
parseJSON :: Value -> Parser RegexMatchSet
parseJSON =
String
-> (Object -> Parser RegexMatchSet)
-> Value
-> Parser RegexMatchSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RegexMatchSet"
( \Object
x ->
Maybe Text
-> Maybe [RegexMatchTuple] -> Maybe Text -> RegexMatchSet
RegexMatchSet'
(Maybe Text
-> Maybe [RegexMatchTuple] -> Maybe Text -> RegexMatchSet)
-> Parser (Maybe Text)
-> Parser (Maybe [RegexMatchTuple] -> Maybe Text -> RegexMatchSet)
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 (Maybe [RegexMatchTuple] -> Maybe Text -> RegexMatchSet)
-> Parser (Maybe [RegexMatchTuple])
-> Parser (Maybe Text -> RegexMatchSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [RegexMatchTuple]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RegexMatchTuples"
Parser (Maybe (Maybe [RegexMatchTuple]))
-> Maybe [RegexMatchTuple] -> Parser (Maybe [RegexMatchTuple])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [RegexMatchTuple]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> RegexMatchSet)
-> Parser (Maybe Text) -> Parser RegexMatchSet
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
"RegexMatchSetId")
)
instance Prelude.Hashable RegexMatchSet
instance Prelude.NFData RegexMatchSet