{-# 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.SecurityHub.Types.AwsWafRegionalRateBasedRuleDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsWafRegionalRateBasedRuleMatchPredicate
data AwsWafRegionalRateBasedRuleDetails = AwsWafRegionalRateBasedRuleDetails'
{
AwsWafRegionalRateBasedRuleDetails -> Maybe Integer
rateLimit :: Prelude.Maybe Prelude.Integer,
AwsWafRegionalRateBasedRuleDetails -> Maybe Text
rateKey :: Prelude.Maybe Prelude.Text,
AwsWafRegionalRateBasedRuleDetails -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
AwsWafRegionalRateBasedRuleDetails -> Maybe Text
ruleId :: Prelude.Maybe Prelude.Text,
AwsWafRegionalRateBasedRuleDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AwsWafRegionalRateBasedRuleDetails
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates :: Prelude.Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
}
deriving (AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool
(AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool)
-> (AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool)
-> Eq AwsWafRegionalRateBasedRuleDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool
$c/= :: AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool
== :: AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool
$c== :: AwsWafRegionalRateBasedRuleDetails
-> AwsWafRegionalRateBasedRuleDetails -> Bool
Prelude.Eq, ReadPrec [AwsWafRegionalRateBasedRuleDetails]
ReadPrec AwsWafRegionalRateBasedRuleDetails
Int -> ReadS AwsWafRegionalRateBasedRuleDetails
ReadS [AwsWafRegionalRateBasedRuleDetails]
(Int -> ReadS AwsWafRegionalRateBasedRuleDetails)
-> ReadS [AwsWafRegionalRateBasedRuleDetails]
-> ReadPrec AwsWafRegionalRateBasedRuleDetails
-> ReadPrec [AwsWafRegionalRateBasedRuleDetails]
-> Read AwsWafRegionalRateBasedRuleDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsWafRegionalRateBasedRuleDetails]
$creadListPrec :: ReadPrec [AwsWafRegionalRateBasedRuleDetails]
readPrec :: ReadPrec AwsWafRegionalRateBasedRuleDetails
$creadPrec :: ReadPrec AwsWafRegionalRateBasedRuleDetails
readList :: ReadS [AwsWafRegionalRateBasedRuleDetails]
$creadList :: ReadS [AwsWafRegionalRateBasedRuleDetails]
readsPrec :: Int -> ReadS AwsWafRegionalRateBasedRuleDetails
$creadsPrec :: Int -> ReadS AwsWafRegionalRateBasedRuleDetails
Prelude.Read, Int -> AwsWafRegionalRateBasedRuleDetails -> ShowS
[AwsWafRegionalRateBasedRuleDetails] -> ShowS
AwsWafRegionalRateBasedRuleDetails -> String
(Int -> AwsWafRegionalRateBasedRuleDetails -> ShowS)
-> (AwsWafRegionalRateBasedRuleDetails -> String)
-> ([AwsWafRegionalRateBasedRuleDetails] -> ShowS)
-> Show AwsWafRegionalRateBasedRuleDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsWafRegionalRateBasedRuleDetails] -> ShowS
$cshowList :: [AwsWafRegionalRateBasedRuleDetails] -> ShowS
show :: AwsWafRegionalRateBasedRuleDetails -> String
$cshow :: AwsWafRegionalRateBasedRuleDetails -> String
showsPrec :: Int -> AwsWafRegionalRateBasedRuleDetails -> ShowS
$cshowsPrec :: Int -> AwsWafRegionalRateBasedRuleDetails -> ShowS
Prelude.Show, (forall x.
AwsWafRegionalRateBasedRuleDetails
-> Rep AwsWafRegionalRateBasedRuleDetails x)
-> (forall x.
Rep AwsWafRegionalRateBasedRuleDetails x
-> AwsWafRegionalRateBasedRuleDetails)
-> Generic AwsWafRegionalRateBasedRuleDetails
forall x.
Rep AwsWafRegionalRateBasedRuleDetails x
-> AwsWafRegionalRateBasedRuleDetails
forall x.
AwsWafRegionalRateBasedRuleDetails
-> Rep AwsWafRegionalRateBasedRuleDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsWafRegionalRateBasedRuleDetails x
-> AwsWafRegionalRateBasedRuleDetails
$cfrom :: forall x.
AwsWafRegionalRateBasedRuleDetails
-> Rep AwsWafRegionalRateBasedRuleDetails x
Prelude.Generic)
newAwsWafRegionalRateBasedRuleDetails ::
AwsWafRegionalRateBasedRuleDetails
newAwsWafRegionalRateBasedRuleDetails :: AwsWafRegionalRateBasedRuleDetails
newAwsWafRegionalRateBasedRuleDetails =
AwsWafRegionalRateBasedRuleDetails' :: Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails'
{ $sel:rateLimit:AwsWafRegionalRateBasedRuleDetails' :: Maybe Integer
rateLimit =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:rateKey:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
rateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metricName:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleId:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
ruleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:matchPredicates:AwsWafRegionalRateBasedRuleDetails' :: Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates = Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
forall a. Maybe a
Prelude.Nothing
}
awsWafRegionalRateBasedRuleDetails_rateLimit :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe Prelude.Integer)
awsWafRegionalRateBasedRuleDetails_rateLimit :: (Maybe Integer -> f (Maybe Integer))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_rateLimit = (AwsWafRegionalRateBasedRuleDetails -> Maybe Integer)
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe Integer -> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe Integer
rateLimit :: Maybe Integer
$sel:rateLimit:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Integer
rateLimit} -> Maybe Integer
rateLimit) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe Integer
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:rateLimit:AwsWafRegionalRateBasedRuleDetails' :: Maybe Integer
rateLimit = Maybe Integer
a} :: AwsWafRegionalRateBasedRuleDetails)
awsWafRegionalRateBasedRuleDetails_rateKey :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe Prelude.Text)
awsWafRegionalRateBasedRuleDetails_rateKey :: (Maybe Text -> f (Maybe Text))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_rateKey = (AwsWafRegionalRateBasedRuleDetails -> Maybe Text)
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe Text -> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe Text
rateKey :: Maybe Text
$sel:rateKey:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
rateKey} -> Maybe Text
rateKey) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe Text
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:rateKey:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
rateKey = Maybe Text
a} :: AwsWafRegionalRateBasedRuleDetails)
awsWafRegionalRateBasedRuleDetails_metricName :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe Prelude.Text)
awsWafRegionalRateBasedRuleDetails_metricName :: (Maybe Text -> f (Maybe Text))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_metricName = (AwsWafRegionalRateBasedRuleDetails -> Maybe Text)
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe Text -> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe Text
metricName :: Maybe Text
$sel:metricName:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe Text
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:metricName:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
metricName = Maybe Text
a} :: AwsWafRegionalRateBasedRuleDetails)
awsWafRegionalRateBasedRuleDetails_ruleId :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe Prelude.Text)
awsWafRegionalRateBasedRuleDetails_ruleId :: (Maybe Text -> f (Maybe Text))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_ruleId = (AwsWafRegionalRateBasedRuleDetails -> Maybe Text)
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe Text -> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe Text
ruleId :: Maybe Text
$sel:ruleId:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
ruleId} -> Maybe Text
ruleId) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe Text
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:ruleId:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
ruleId = Maybe Text
a} :: AwsWafRegionalRateBasedRuleDetails)
awsWafRegionalRateBasedRuleDetails_name :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe Prelude.Text)
awsWafRegionalRateBasedRuleDetails_name :: (Maybe Text -> f (Maybe Text))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_name = (AwsWafRegionalRateBasedRuleDetails -> Maybe Text)
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe Text -> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe Text
name :: Maybe Text
$sel:name:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe Text
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:name:AwsWafRegionalRateBasedRuleDetails' :: Maybe Text
name = Maybe Text
a} :: AwsWafRegionalRateBasedRuleDetails)
awsWafRegionalRateBasedRuleDetails_matchPredicates :: Lens.Lens' AwsWafRegionalRateBasedRuleDetails (Prelude.Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
awsWafRegionalRateBasedRuleDetails_matchPredicates :: (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> f (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
awsWafRegionalRateBasedRuleDetails_matchPredicates = (AwsWafRegionalRateBasedRuleDetails
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
-> (AwsWafRegionalRateBasedRuleDetails
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Lens
AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsWafRegionalRateBasedRuleDetails' {Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates :: Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
$sel:matchPredicates:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates} -> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates) (\s :: AwsWafRegionalRateBasedRuleDetails
s@AwsWafRegionalRateBasedRuleDetails' {} Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
a -> AwsWafRegionalRateBasedRuleDetails
s {$sel:matchPredicates:AwsWafRegionalRateBasedRuleDetails' :: Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates = Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
a} :: AwsWafRegionalRateBasedRuleDetails) ((Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> f (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails)
-> ((Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> f (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> f (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> f (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> AwsWafRegionalRateBasedRuleDetails
-> f AwsWafRegionalRateBasedRuleDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
-> Iso
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
[AwsWafRegionalRateBasedRuleMatchPredicate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.FromJSON
AwsWafRegionalRateBasedRuleDetails
where
parseJSON :: Value -> Parser AwsWafRegionalRateBasedRuleDetails
parseJSON =
String
-> (Object -> Parser AwsWafRegionalRateBasedRuleDetails)
-> Value
-> Parser AwsWafRegionalRateBasedRuleDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsWafRegionalRateBasedRuleDetails"
( \Object
x ->
Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails
AwsWafRegionalRateBasedRuleDetails'
(Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe Integer)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RateLimit")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RateKey")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MetricName")
Parser
(Maybe Text
-> Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleId")
Parser
(Maybe Text
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser
(Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> AwsWafRegionalRateBasedRuleDetails)
-> Parser (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
-> Parser AwsWafRegionalRateBasedRuleDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser
(Maybe (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MatchPredicates"
Parser (Maybe (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]))
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
-> Parser (Maybe [AwsWafRegionalRateBasedRuleMatchPredicate])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
forall a. Monoid a => a
Prelude.mempty
)
)
instance
Prelude.Hashable
AwsWafRegionalRateBasedRuleDetails
instance
Prelude.NFData
AwsWafRegionalRateBasedRuleDetails
instance
Core.ToJSON
AwsWafRegionalRateBasedRuleDetails
where
toJSON :: AwsWafRegionalRateBasedRuleDetails -> Value
toJSON AwsWafRegionalRateBasedRuleDetails' {Maybe Integer
Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
Maybe Text
matchPredicates :: Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
name :: Maybe Text
ruleId :: Maybe Text
metricName :: Maybe Text
rateKey :: Maybe Text
rateLimit :: Maybe Integer
$sel:matchPredicates:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
$sel:name:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
$sel:ruleId:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
$sel:metricName:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
$sel:rateKey:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Text
$sel:rateLimit:AwsWafRegionalRateBasedRuleDetails' :: AwsWafRegionalRateBasedRuleDetails -> Maybe Integer
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RateLimit" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
rateLimit,
(Text
"RateKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rateKey,
(Text
"MetricName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
metricName,
(Text
"RuleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ruleId,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"MatchPredicates" Text -> [AwsWafRegionalRateBasedRuleMatchPredicate] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([AwsWafRegionalRateBasedRuleMatchPredicate] -> Pair)
-> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsWafRegionalRateBasedRuleMatchPredicate]
matchPredicates
]
)