{-# 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.RuleSummary 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 RuleSummary = RuleSummary'
{
RuleSummary -> Text
ruleId :: Prelude.Text,
RuleSummary -> Text
name :: Prelude.Text
}
deriving (RuleSummary -> RuleSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleSummary -> RuleSummary -> Bool
$c/= :: RuleSummary -> RuleSummary -> Bool
== :: RuleSummary -> RuleSummary -> Bool
$c== :: RuleSummary -> RuleSummary -> Bool
Prelude.Eq, ReadPrec [RuleSummary]
ReadPrec RuleSummary
Int -> ReadS RuleSummary
ReadS [RuleSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleSummary]
$creadListPrec :: ReadPrec [RuleSummary]
readPrec :: ReadPrec RuleSummary
$creadPrec :: ReadPrec RuleSummary
readList :: ReadS [RuleSummary]
$creadList :: ReadS [RuleSummary]
readsPrec :: Int -> ReadS RuleSummary
$creadsPrec :: Int -> ReadS RuleSummary
Prelude.Read, Int -> RuleSummary -> ShowS
[RuleSummary] -> ShowS
RuleSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleSummary] -> ShowS
$cshowList :: [RuleSummary] -> ShowS
show :: RuleSummary -> String
$cshow :: RuleSummary -> String
showsPrec :: Int -> RuleSummary -> ShowS
$cshowsPrec :: Int -> RuleSummary -> ShowS
Prelude.Show, forall x. Rep RuleSummary x -> RuleSummary
forall x. RuleSummary -> Rep RuleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleSummary x -> RuleSummary
$cfrom :: forall x. RuleSummary -> Rep RuleSummary x
Prelude.Generic)
newRuleSummary ::
Prelude.Text ->
Prelude.Text ->
RuleSummary
newRuleSummary :: Text -> Text -> RuleSummary
newRuleSummary Text
pRuleId_ Text
pName_ =
RuleSummary' {$sel:ruleId:RuleSummary' :: Text
ruleId = Text
pRuleId_, $sel:name:RuleSummary' :: Text
name = Text
pName_}
ruleSummary_ruleId :: Lens.Lens' RuleSummary Prelude.Text
ruleSummary_ruleId :: Lens' RuleSummary Text
ruleSummary_ruleId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {Text
ruleId :: Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
ruleId} -> Text
ruleId) (\s :: RuleSummary
s@RuleSummary' {} Text
a -> RuleSummary
s {$sel:ruleId:RuleSummary' :: Text
ruleId = Text
a} :: RuleSummary)
ruleSummary_name :: Lens.Lens' RuleSummary Prelude.Text
ruleSummary_name :: Lens' RuleSummary Text
ruleSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleSummary' {Text
name :: Text
$sel:name:RuleSummary' :: RuleSummary -> Text
name} -> Text
name) (\s :: RuleSummary
s@RuleSummary' {} Text
a -> RuleSummary
s {$sel:name:RuleSummary' :: Text
name = Text
a} :: RuleSummary)
instance Data.FromJSON RuleSummary where
parseJSON :: Value -> Parser RuleSummary
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RuleSummary"
( \Object
x ->
Text -> Text -> RuleSummary
RuleSummary'
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
"RuleId")
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
"Name")
)
instance Prelude.Hashable RuleSummary where
hashWithSalt :: Int -> RuleSummary -> Int
hashWithSalt Int
_salt RuleSummary' {Text
name :: Text
ruleId :: Text
$sel:name:RuleSummary' :: RuleSummary -> Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData RuleSummary where
rnf :: RuleSummary -> ()
rnf RuleSummary' {Text
name :: Text
ruleId :: Text
$sel:name:RuleSummary' :: RuleSummary -> Text
$sel:ruleId:RuleSummary' :: RuleSummary -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
ruleId seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name