{-# 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.ExcludedRule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExcludedRule = ExcludedRule'
{
ExcludedRule -> Text
ruleId :: Prelude.Text
}
deriving (ExcludedRule -> ExcludedRule -> Bool
(ExcludedRule -> ExcludedRule -> Bool)
-> (ExcludedRule -> ExcludedRule -> Bool) -> Eq ExcludedRule
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]
(Int -> ReadS ExcludedRule)
-> ReadS [ExcludedRule]
-> ReadPrec ExcludedRule
-> ReadPrec [ExcludedRule]
-> Read 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
(Int -> ExcludedRule -> ShowS)
-> (ExcludedRule -> String)
-> ([ExcludedRule] -> ShowS)
-> Show ExcludedRule
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. ExcludedRule -> Rep ExcludedRule x)
-> (forall x. Rep ExcludedRule x -> ExcludedRule)
-> Generic ExcludedRule
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
pRuleId_ =
ExcludedRule' :: Text -> ExcludedRule
ExcludedRule' {$sel:ruleId:ExcludedRule' :: Text
ruleId = Text
pRuleId_}
excludedRule_ruleId :: Lens.Lens' ExcludedRule Prelude.Text
excludedRule_ruleId :: (Text -> f Text) -> ExcludedRule -> f ExcludedRule
excludedRule_ruleId = (ExcludedRule -> Text)
-> (ExcludedRule -> Text -> ExcludedRule)
-> Lens ExcludedRule ExcludedRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExcludedRule' {Text
ruleId :: Text
$sel:ruleId:ExcludedRule' :: ExcludedRule -> Text
ruleId} -> Text
ruleId) (\s :: ExcludedRule
s@ExcludedRule' {} Text
a -> ExcludedRule
s {$sel:ruleId:ExcludedRule' :: Text
ruleId = Text
a} :: ExcludedRule)
instance Core.FromJSON ExcludedRule where
parseJSON :: Value -> Parser ExcludedRule
parseJSON =
String
-> (Object -> Parser ExcludedRule) -> Value -> Parser ExcludedRule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExcludedRule"
( \Object
x ->
Text -> ExcludedRule
ExcludedRule' (Text -> ExcludedRule) -> Parser Text -> Parser ExcludedRule
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RuleId")
)
instance Prelude.Hashable ExcludedRule
instance Prelude.NFData ExcludedRule
instance Core.ToJSON ExcludedRule where
toJSON :: ExcludedRule -> Value
toJSON ExcludedRule' {Text
ruleId :: Text
$sel:ruleId:ExcludedRule' :: ExcludedRule -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RuleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleId)]
)