{-# 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.ExcludedRule 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
data ExcludedRule = ExcludedRule'
{
ExcludedRule -> Text
name :: Prelude.Text
}
deriving (ExcludedRule -> ExcludedRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExcludedRule -> ExcludedRule -> Bool
$c/= :: ExcludedRule -> ExcludedRule -> Bool
== :: ExcludedRule -> ExcludedRule -> Bool
$c== :: ExcludedRule -> ExcludedRule -> Bool
Prelude.Eq, ReadPrec [ExcludedRule]
ReadPrec ExcludedRule
Int -> ReadS ExcludedRule
ReadS [ExcludedRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExcludedRule]
$creadListPrec :: ReadPrec [ExcludedRule]
readPrec :: ReadPrec ExcludedRule
$creadPrec :: ReadPrec ExcludedRule
readList :: ReadS [ExcludedRule]
$creadList :: ReadS [ExcludedRule]
readsPrec :: Int -> ReadS ExcludedRule
$creadsPrec :: Int -> ReadS ExcludedRule
Prelude.Read, Int -> ExcludedRule -> ShowS
[ExcludedRule] -> ShowS
ExcludedRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExcludedRule] -> ShowS
$cshowList :: [ExcludedRule] -> ShowS
show :: ExcludedRule -> String
$cshow :: ExcludedRule -> String
showsPrec :: Int -> ExcludedRule -> ShowS
$cshowsPrec :: Int -> ExcludedRule -> ShowS
Prelude.Show, forall x. Rep ExcludedRule x -> ExcludedRule
forall x. ExcludedRule -> Rep ExcludedRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExcludedRule x -> ExcludedRule
$cfrom :: forall x. ExcludedRule -> Rep ExcludedRule x
Prelude.Generic)
newExcludedRule ::
Prelude.Text ->
ExcludedRule
newExcludedRule :: Text -> ExcludedRule
newExcludedRule Text
pName_ = ExcludedRule' {$sel:name:ExcludedRule' :: Text
name = Text
pName_}
excludedRule_name :: Lens.Lens' ExcludedRule Prelude.Text
excludedRule_name :: Lens' ExcludedRule Text
excludedRule_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExcludedRule' {Text
name :: Text
$sel:name:ExcludedRule' :: ExcludedRule -> Text
name} -> Text
name) (\s :: ExcludedRule
s@ExcludedRule' {} Text
a -> ExcludedRule
s {$sel:name:ExcludedRule' :: Text
name = Text
a} :: ExcludedRule)
instance Data.FromJSON ExcludedRule where
parseJSON :: Value -> Parser ExcludedRule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ExcludedRule"
(\Object
x -> Text -> ExcludedRule
ExcludedRule' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name"))
instance Prelude.Hashable ExcludedRule where
hashWithSalt :: Int -> ExcludedRule -> Int
hashWithSalt Int
_salt ExcludedRule' {Text
name :: Text
$sel:name:ExcludedRule' :: ExcludedRule -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData ExcludedRule where
rnf :: ExcludedRule -> ()
rnf ExcludedRule' {Text
name :: Text
$sel:name:ExcludedRule' :: ExcludedRule -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToJSON ExcludedRule where
toJSON :: ExcludedRule -> Value
toJSON ExcludedRule' {Text
name :: Text
$sel:name:ExcludedRule' :: ExcludedRule -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
)