{-# 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.RuleGroupSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RuleGroupSummary = RuleGroupSummary'
{
RuleGroupSummary -> Text
ruleGroupId :: Prelude.Text,
RuleGroupSummary -> Text
name :: Prelude.Text
}
deriving (RuleGroupSummary -> RuleGroupSummary -> Bool
(RuleGroupSummary -> RuleGroupSummary -> Bool)
-> (RuleGroupSummary -> RuleGroupSummary -> Bool)
-> Eq RuleGroupSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleGroupSummary -> RuleGroupSummary -> Bool
$c/= :: RuleGroupSummary -> RuleGroupSummary -> Bool
== :: RuleGroupSummary -> RuleGroupSummary -> Bool
$c== :: RuleGroupSummary -> RuleGroupSummary -> Bool
Prelude.Eq, ReadPrec [RuleGroupSummary]
ReadPrec RuleGroupSummary
Int -> ReadS RuleGroupSummary
ReadS [RuleGroupSummary]
(Int -> ReadS RuleGroupSummary)
-> ReadS [RuleGroupSummary]
-> ReadPrec RuleGroupSummary
-> ReadPrec [RuleGroupSummary]
-> Read RuleGroupSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleGroupSummary]
$creadListPrec :: ReadPrec [RuleGroupSummary]
readPrec :: ReadPrec RuleGroupSummary
$creadPrec :: ReadPrec RuleGroupSummary
readList :: ReadS [RuleGroupSummary]
$creadList :: ReadS [RuleGroupSummary]
readsPrec :: Int -> ReadS RuleGroupSummary
$creadsPrec :: Int -> ReadS RuleGroupSummary
Prelude.Read, Int -> RuleGroupSummary -> ShowS
[RuleGroupSummary] -> ShowS
RuleGroupSummary -> String
(Int -> RuleGroupSummary -> ShowS)
-> (RuleGroupSummary -> String)
-> ([RuleGroupSummary] -> ShowS)
-> Show RuleGroupSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleGroupSummary] -> ShowS
$cshowList :: [RuleGroupSummary] -> ShowS
show :: RuleGroupSummary -> String
$cshow :: RuleGroupSummary -> String
showsPrec :: Int -> RuleGroupSummary -> ShowS
$cshowsPrec :: Int -> RuleGroupSummary -> ShowS
Prelude.Show, (forall x. RuleGroupSummary -> Rep RuleGroupSummary x)
-> (forall x. Rep RuleGroupSummary x -> RuleGroupSummary)
-> Generic RuleGroupSummary
forall x. Rep RuleGroupSummary x -> RuleGroupSummary
forall x. RuleGroupSummary -> Rep RuleGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleGroupSummary x -> RuleGroupSummary
$cfrom :: forall x. RuleGroupSummary -> Rep RuleGroupSummary x
Prelude.Generic)
newRuleGroupSummary ::
Prelude.Text ->
Prelude.Text ->
RuleGroupSummary
newRuleGroupSummary :: Text -> Text -> RuleGroupSummary
newRuleGroupSummary Text
pRuleGroupId_ Text
pName_ =
RuleGroupSummary' :: Text -> Text -> RuleGroupSummary
RuleGroupSummary'
{ $sel:ruleGroupId:RuleGroupSummary' :: Text
ruleGroupId = Text
pRuleGroupId_,
$sel:name:RuleGroupSummary' :: Text
name = Text
pName_
}
ruleGroupSummary_ruleGroupId :: Lens.Lens' RuleGroupSummary Prelude.Text
ruleGroupSummary_ruleGroupId :: (Text -> f Text) -> RuleGroupSummary -> f RuleGroupSummary
ruleGroupSummary_ruleGroupId = (RuleGroupSummary -> Text)
-> (RuleGroupSummary -> Text -> RuleGroupSummary)
-> Lens RuleGroupSummary RuleGroupSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupSummary' {Text
ruleGroupId :: Text
$sel:ruleGroupId:RuleGroupSummary' :: RuleGroupSummary -> Text
ruleGroupId} -> Text
ruleGroupId) (\s :: RuleGroupSummary
s@RuleGroupSummary' {} Text
a -> RuleGroupSummary
s {$sel:ruleGroupId:RuleGroupSummary' :: Text
ruleGroupId = Text
a} :: RuleGroupSummary)
ruleGroupSummary_name :: Lens.Lens' RuleGroupSummary Prelude.Text
ruleGroupSummary_name :: (Text -> f Text) -> RuleGroupSummary -> f RuleGroupSummary
ruleGroupSummary_name = (RuleGroupSummary -> Text)
-> (RuleGroupSummary -> Text -> RuleGroupSummary)
-> Lens RuleGroupSummary RuleGroupSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupSummary' {Text
name :: Text
$sel:name:RuleGroupSummary' :: RuleGroupSummary -> Text
name} -> Text
name) (\s :: RuleGroupSummary
s@RuleGroupSummary' {} Text
a -> RuleGroupSummary
s {$sel:name:RuleGroupSummary' :: Text
name = Text
a} :: RuleGroupSummary)
instance Core.FromJSON RuleGroupSummary where
parseJSON :: Value -> Parser RuleGroupSummary
parseJSON =
String
-> (Object -> Parser RuleGroupSummary)
-> Value
-> Parser RuleGroupSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RuleGroupSummary"
( \Object
x ->
Text -> Text -> RuleGroupSummary
RuleGroupSummary'
(Text -> Text -> RuleGroupSummary)
-> Parser Text -> Parser (Text -> RuleGroupSummary)
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
"RuleGroupId")
Parser (Text -> RuleGroupSummary)
-> Parser Text -> Parser RuleGroupSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable RuleGroupSummary
instance Prelude.NFData RuleGroupSummary