{-# 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.RegexPatternSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RegexPatternSet = RegexPatternSet'
{
RegexPatternSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
RegexPatternSet -> Text
regexPatternSetId :: Prelude.Text,
RegexPatternSet -> [Text]
regexPatternStrings :: [Prelude.Text]
}
deriving (RegexPatternSet -> RegexPatternSet -> Bool
(RegexPatternSet -> RegexPatternSet -> Bool)
-> (RegexPatternSet -> RegexPatternSet -> Bool)
-> Eq RegexPatternSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegexPatternSet -> RegexPatternSet -> Bool
$c/= :: RegexPatternSet -> RegexPatternSet -> Bool
== :: RegexPatternSet -> RegexPatternSet -> Bool
$c== :: RegexPatternSet -> RegexPatternSet -> Bool
Prelude.Eq, ReadPrec [RegexPatternSet]
ReadPrec RegexPatternSet
Int -> ReadS RegexPatternSet
ReadS [RegexPatternSet]
(Int -> ReadS RegexPatternSet)
-> ReadS [RegexPatternSet]
-> ReadPrec RegexPatternSet
-> ReadPrec [RegexPatternSet]
-> Read RegexPatternSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegexPatternSet]
$creadListPrec :: ReadPrec [RegexPatternSet]
readPrec :: ReadPrec RegexPatternSet
$creadPrec :: ReadPrec RegexPatternSet
readList :: ReadS [RegexPatternSet]
$creadList :: ReadS [RegexPatternSet]
readsPrec :: Int -> ReadS RegexPatternSet
$creadsPrec :: Int -> ReadS RegexPatternSet
Prelude.Read, Int -> RegexPatternSet -> ShowS
[RegexPatternSet] -> ShowS
RegexPatternSet -> String
(Int -> RegexPatternSet -> ShowS)
-> (RegexPatternSet -> String)
-> ([RegexPatternSet] -> ShowS)
-> Show RegexPatternSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegexPatternSet] -> ShowS
$cshowList :: [RegexPatternSet] -> ShowS
show :: RegexPatternSet -> String
$cshow :: RegexPatternSet -> String
showsPrec :: Int -> RegexPatternSet -> ShowS
$cshowsPrec :: Int -> RegexPatternSet -> ShowS
Prelude.Show, (forall x. RegexPatternSet -> Rep RegexPatternSet x)
-> (forall x. Rep RegexPatternSet x -> RegexPatternSet)
-> Generic RegexPatternSet
forall x. Rep RegexPatternSet x -> RegexPatternSet
forall x. RegexPatternSet -> Rep RegexPatternSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegexPatternSet x -> RegexPatternSet
$cfrom :: forall x. RegexPatternSet -> Rep RegexPatternSet x
Prelude.Generic)
newRegexPatternSet ::
Prelude.Text ->
RegexPatternSet
newRegexPatternSet :: Text -> RegexPatternSet
newRegexPatternSet Text
pRegexPatternSetId_ =
RegexPatternSet' :: Maybe Text -> Text -> [Text] -> RegexPatternSet
RegexPatternSet'
{ $sel:name:RegexPatternSet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:regexPatternSetId:RegexPatternSet' :: Text
regexPatternSetId = Text
pRegexPatternSetId_,
$sel:regexPatternStrings:RegexPatternSet' :: [Text]
regexPatternStrings = [Text]
forall a. Monoid a => a
Prelude.mempty
}
regexPatternSet_name :: Lens.Lens' RegexPatternSet (Prelude.Maybe Prelude.Text)
regexPatternSet_name :: (Maybe Text -> f (Maybe Text))
-> RegexPatternSet -> f RegexPatternSet
regexPatternSet_name = (RegexPatternSet -> Maybe Text)
-> (RegexPatternSet -> Maybe Text -> RegexPatternSet)
-> Lens RegexPatternSet RegexPatternSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Maybe Text
name :: Maybe Text
$sel:name:RegexPatternSet' :: RegexPatternSet -> Maybe Text
name} -> Maybe Text
name) (\s :: RegexPatternSet
s@RegexPatternSet' {} Maybe Text
a -> RegexPatternSet
s {$sel:name:RegexPatternSet' :: Maybe Text
name = Maybe Text
a} :: RegexPatternSet)
regexPatternSet_regexPatternSetId :: Lens.Lens' RegexPatternSet Prelude.Text
regexPatternSet_regexPatternSetId :: (Text -> f Text) -> RegexPatternSet -> f RegexPatternSet
regexPatternSet_regexPatternSetId = (RegexPatternSet -> Text)
-> (RegexPatternSet -> Text -> RegexPatternSet)
-> Lens RegexPatternSet RegexPatternSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Text
regexPatternSetId :: Text
$sel:regexPatternSetId:RegexPatternSet' :: RegexPatternSet -> Text
regexPatternSetId} -> Text
regexPatternSetId) (\s :: RegexPatternSet
s@RegexPatternSet' {} Text
a -> RegexPatternSet
s {$sel:regexPatternSetId:RegexPatternSet' :: Text
regexPatternSetId = Text
a} :: RegexPatternSet)
regexPatternSet_regexPatternStrings :: Lens.Lens' RegexPatternSet [Prelude.Text]
regexPatternSet_regexPatternStrings :: ([Text] -> f [Text]) -> RegexPatternSet -> f RegexPatternSet
regexPatternSet_regexPatternStrings = (RegexPatternSet -> [Text])
-> (RegexPatternSet -> [Text] -> RegexPatternSet)
-> Lens RegexPatternSet RegexPatternSet [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {[Text]
regexPatternStrings :: [Text]
$sel:regexPatternStrings:RegexPatternSet' :: RegexPatternSet -> [Text]
regexPatternStrings} -> [Text]
regexPatternStrings) (\s :: RegexPatternSet
s@RegexPatternSet' {} [Text]
a -> RegexPatternSet
s {$sel:regexPatternStrings:RegexPatternSet' :: [Text]
regexPatternStrings = [Text]
a} :: RegexPatternSet) (([Text] -> f [Text]) -> RegexPatternSet -> f RegexPatternSet)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> RegexPatternSet
-> f RegexPatternSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON RegexPatternSet where
parseJSON :: Value -> Parser RegexPatternSet
parseJSON =
String
-> (Object -> Parser RegexPatternSet)
-> Value
-> Parser RegexPatternSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RegexPatternSet"
( \Object
x ->
Maybe Text -> Text -> [Text] -> RegexPatternSet
RegexPatternSet'
(Maybe Text -> Text -> [Text] -> RegexPatternSet)
-> Parser (Maybe Text)
-> Parser (Text -> [Text] -> RegexPatternSet)
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 -> [Text] -> RegexPatternSet)
-> Parser Text -> Parser ([Text] -> RegexPatternSet)
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
"RegexPatternSetId")
Parser ([Text] -> RegexPatternSet)
-> Parser [Text] -> Parser RegexPatternSet
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
"RegexPatternStrings"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable RegexPatternSet
instance Prelude.NFData RegexPatternSet