{-# 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.WAFV2.Types.RegexPatternSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WAFV2.Types.Regex
data RegexPatternSet = RegexPatternSet'
{
RegexPatternSet -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
RegexPatternSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
RegexPatternSet -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
RegexPatternSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
RegexPatternSet -> Maybe [Regex]
regularExpressionList :: Prelude.Maybe [Regex]
}
deriving (RegexPatternSet -> RegexPatternSet -> Bool
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]
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
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. 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 ::
RegexPatternSet
newRegexPatternSet :: RegexPatternSet
newRegexPatternSet =
RegexPatternSet'
{ $sel:arn:RegexPatternSet' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:description:RegexPatternSet' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:id:RegexPatternSet' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:name:RegexPatternSet' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:regularExpressionList:RegexPatternSet' :: Maybe [Regex]
regularExpressionList = forall a. Maybe a
Prelude.Nothing
}
regexPatternSet_arn :: Lens.Lens' RegexPatternSet (Prelude.Maybe Prelude.Text)
regexPatternSet_arn :: Lens' RegexPatternSet (Maybe Text)
regexPatternSet_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Maybe Text
arn :: Maybe Text
$sel:arn:RegexPatternSet' :: RegexPatternSet -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RegexPatternSet
s@RegexPatternSet' {} Maybe Text
a -> RegexPatternSet
s {$sel:arn:RegexPatternSet' :: Maybe Text
arn = Maybe Text
a} :: RegexPatternSet)
regexPatternSet_description :: Lens.Lens' RegexPatternSet (Prelude.Maybe Prelude.Text)
regexPatternSet_description :: Lens' RegexPatternSet (Maybe Text)
regexPatternSet_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Maybe Text
description :: Maybe Text
$sel:description:RegexPatternSet' :: RegexPatternSet -> Maybe Text
description} -> Maybe Text
description) (\s :: RegexPatternSet
s@RegexPatternSet' {} Maybe Text
a -> RegexPatternSet
s {$sel:description:RegexPatternSet' :: Maybe Text
description = Maybe Text
a} :: RegexPatternSet)
regexPatternSet_id :: Lens.Lens' RegexPatternSet (Prelude.Maybe Prelude.Text)
regexPatternSet_id :: Lens' RegexPatternSet (Maybe Text)
regexPatternSet_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Maybe Text
id :: Maybe Text
$sel:id:RegexPatternSet' :: RegexPatternSet -> Maybe Text
id} -> Maybe Text
id) (\s :: RegexPatternSet
s@RegexPatternSet' {} Maybe Text
a -> RegexPatternSet
s {$sel:id:RegexPatternSet' :: Maybe Text
id = Maybe Text
a} :: RegexPatternSet)
regexPatternSet_name :: Lens.Lens' RegexPatternSet (Prelude.Maybe Prelude.Text)
regexPatternSet_name :: Lens' RegexPatternSet (Maybe Text)
regexPatternSet_name = 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_regularExpressionList :: Lens.Lens' RegexPatternSet (Prelude.Maybe [Regex])
regexPatternSet_regularExpressionList :: Lens' RegexPatternSet (Maybe [Regex])
regexPatternSet_regularExpressionList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSet' {Maybe [Regex]
regularExpressionList :: Maybe [Regex]
$sel:regularExpressionList:RegexPatternSet' :: RegexPatternSet -> Maybe [Regex]
regularExpressionList} -> Maybe [Regex]
regularExpressionList) (\s :: RegexPatternSet
s@RegexPatternSet' {} Maybe [Regex]
a -> RegexPatternSet
s {$sel:regularExpressionList:RegexPatternSet' :: Maybe [Regex]
regularExpressionList = Maybe [Regex]
a} :: RegexPatternSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON RegexPatternSet where
parseJSON :: Value -> Parser RegexPatternSet
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RegexPatternSet"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Regex]
-> RegexPatternSet
RegexPatternSet'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ARN")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RegularExpressionList"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable RegexPatternSet where
hashWithSalt :: Int -> RegexPatternSet -> Int
hashWithSalt Int
_salt RegexPatternSet' {Maybe [Regex]
Maybe Text
regularExpressionList :: Maybe [Regex]
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:regularExpressionList:RegexPatternSet' :: RegexPatternSet -> Maybe [Regex]
$sel:name:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:id:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:description:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:arn:RegexPatternSet' :: RegexPatternSet -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Regex]
regularExpressionList
instance Prelude.NFData RegexPatternSet where
rnf :: RegexPatternSet -> ()
rnf RegexPatternSet' {Maybe [Regex]
Maybe Text
regularExpressionList :: Maybe [Regex]
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:regularExpressionList:RegexPatternSet' :: RegexPatternSet -> Maybe [Regex]
$sel:name:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:id:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:description:RegexPatternSet' :: RegexPatternSet -> Maybe Text
$sel:arn:RegexPatternSet' :: RegexPatternSet -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Regex]
regularExpressionList