{-# 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.ByteMatchSet 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.WAFRegional.Types.ByteMatchTuple
data ByteMatchSet = ByteMatchSet'
{
ByteMatchSet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ByteMatchSet -> Text
byteMatchSetId :: Prelude.Text,
ByteMatchSet -> [ByteMatchTuple]
byteMatchTuples :: [ByteMatchTuple]
}
deriving (ByteMatchSet -> ByteMatchSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ByteMatchSet -> ByteMatchSet -> Bool
$c/= :: ByteMatchSet -> ByteMatchSet -> Bool
== :: ByteMatchSet -> ByteMatchSet -> Bool
$c== :: ByteMatchSet -> ByteMatchSet -> Bool
Prelude.Eq, ReadPrec [ByteMatchSet]
ReadPrec ByteMatchSet
Int -> ReadS ByteMatchSet
ReadS [ByteMatchSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ByteMatchSet]
$creadListPrec :: ReadPrec [ByteMatchSet]
readPrec :: ReadPrec ByteMatchSet
$creadPrec :: ReadPrec ByteMatchSet
readList :: ReadS [ByteMatchSet]
$creadList :: ReadS [ByteMatchSet]
readsPrec :: Int -> ReadS ByteMatchSet
$creadsPrec :: Int -> ReadS ByteMatchSet
Prelude.Read, Int -> ByteMatchSet -> ShowS
[ByteMatchSet] -> ShowS
ByteMatchSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ByteMatchSet] -> ShowS
$cshowList :: [ByteMatchSet] -> ShowS
show :: ByteMatchSet -> String
$cshow :: ByteMatchSet -> String
showsPrec :: Int -> ByteMatchSet -> ShowS
$cshowsPrec :: Int -> ByteMatchSet -> ShowS
Prelude.Show, forall x. Rep ByteMatchSet x -> ByteMatchSet
forall x. ByteMatchSet -> Rep ByteMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ByteMatchSet x -> ByteMatchSet
$cfrom :: forall x. ByteMatchSet -> Rep ByteMatchSet x
Prelude.Generic)
newByteMatchSet ::
Prelude.Text ->
ByteMatchSet
newByteMatchSet :: Text -> ByteMatchSet
newByteMatchSet Text
pByteMatchSetId_ =
ByteMatchSet'
{ $sel:name:ByteMatchSet' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:byteMatchSetId:ByteMatchSet' :: Text
byteMatchSetId = Text
pByteMatchSetId_,
$sel:byteMatchTuples:ByteMatchSet' :: [ByteMatchTuple]
byteMatchTuples = forall a. Monoid a => a
Prelude.mempty
}
byteMatchSet_name :: Lens.Lens' ByteMatchSet (Prelude.Maybe Prelude.Text)
byteMatchSet_name :: Lens' ByteMatchSet (Maybe Text)
byteMatchSet_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSet' {Maybe Text
name :: Maybe Text
$sel:name:ByteMatchSet' :: ByteMatchSet -> Maybe Text
name} -> Maybe Text
name) (\s :: ByteMatchSet
s@ByteMatchSet' {} Maybe Text
a -> ByteMatchSet
s {$sel:name:ByteMatchSet' :: Maybe Text
name = Maybe Text
a} :: ByteMatchSet)
byteMatchSet_byteMatchSetId :: Lens.Lens' ByteMatchSet Prelude.Text
byteMatchSet_byteMatchSetId :: Lens' ByteMatchSet Text
byteMatchSet_byteMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSet' {Text
byteMatchSetId :: Text
$sel:byteMatchSetId:ByteMatchSet' :: ByteMatchSet -> Text
byteMatchSetId} -> Text
byteMatchSetId) (\s :: ByteMatchSet
s@ByteMatchSet' {} Text
a -> ByteMatchSet
s {$sel:byteMatchSetId:ByteMatchSet' :: Text
byteMatchSetId = Text
a} :: ByteMatchSet)
byteMatchSet_byteMatchTuples :: Lens.Lens' ByteMatchSet [ByteMatchTuple]
byteMatchSet_byteMatchTuples :: Lens' ByteMatchSet [ByteMatchTuple]
byteMatchSet_byteMatchTuples = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSet' {[ByteMatchTuple]
byteMatchTuples :: [ByteMatchTuple]
$sel:byteMatchTuples:ByteMatchSet' :: ByteMatchSet -> [ByteMatchTuple]
byteMatchTuples} -> [ByteMatchTuple]
byteMatchTuples) (\s :: ByteMatchSet
s@ByteMatchSet' {} [ByteMatchTuple]
a -> ByteMatchSet
s {$sel:byteMatchTuples:ByteMatchSet' :: [ByteMatchTuple]
byteMatchTuples = [ByteMatchTuple]
a} :: ByteMatchSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ByteMatchSet where
parseJSON :: Value -> Parser ByteMatchSet
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ByteMatchSet"
( \Object
x ->
Maybe Text -> Text -> [ByteMatchTuple] -> ByteMatchSet
ByteMatchSet'
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
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ByteMatchSetId")
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
"ByteMatchTuples"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ByteMatchSet where
hashWithSalt :: Int -> ByteMatchSet -> Int
hashWithSalt Int
_salt ByteMatchSet' {[ByteMatchTuple]
Maybe Text
Text
byteMatchTuples :: [ByteMatchTuple]
byteMatchSetId :: Text
name :: Maybe Text
$sel:byteMatchTuples:ByteMatchSet' :: ByteMatchSet -> [ByteMatchTuple]
$sel:byteMatchSetId:ByteMatchSet' :: ByteMatchSet -> Text
$sel:name:ByteMatchSet' :: ByteMatchSet -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
byteMatchSetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [ByteMatchTuple]
byteMatchTuples
instance Prelude.NFData ByteMatchSet where
rnf :: ByteMatchSet -> ()
rnf ByteMatchSet' {[ByteMatchTuple]
Maybe Text
Text
byteMatchTuples :: [ByteMatchTuple]
byteMatchSetId :: Text
name :: Maybe Text
$sel:byteMatchTuples:ByteMatchSet' :: ByteMatchSet -> [ByteMatchTuple]
$sel:byteMatchSetId:ByteMatchSet' :: ByteMatchSet -> Text
$sel:name:ByteMatchSet' :: ByteMatchSet -> Maybe Text
..} =
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 Text
byteMatchSetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ByteMatchTuple]
byteMatchTuples