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