module Stratosphere.WAFRegional.RateBasedRule (
module Exports, RateBasedRule(..), mkRateBasedRule
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFRegional.RateBasedRule.PredicateProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RateBasedRule
=
RateBasedRule {RateBasedRule -> ()
haddock_workaround_ :: (),
RateBasedRule -> Maybe [PredicateProperty]
matchPredicates :: (Prelude.Maybe [PredicateProperty]),
RateBasedRule -> Value Text
metricName :: (Value Prelude.Text),
RateBasedRule -> Value Text
name :: (Value Prelude.Text),
RateBasedRule -> Value Text
rateKey :: (Value Prelude.Text),
RateBasedRule -> Value Integer
rateLimit :: (Value Prelude.Integer)}
deriving stock (RateBasedRule -> RateBasedRule -> Bool
(RateBasedRule -> RateBasedRule -> Bool)
-> (RateBasedRule -> RateBasedRule -> Bool) -> Eq RateBasedRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RateBasedRule -> RateBasedRule -> Bool
== :: RateBasedRule -> RateBasedRule -> Bool
$c/= :: RateBasedRule -> RateBasedRule -> Bool
/= :: RateBasedRule -> RateBasedRule -> Bool
Prelude.Eq, Int -> RateBasedRule -> ShowS
[RateBasedRule] -> ShowS
RateBasedRule -> String
(Int -> RateBasedRule -> ShowS)
-> (RateBasedRule -> String)
-> ([RateBasedRule] -> ShowS)
-> Show RateBasedRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RateBasedRule -> ShowS
showsPrec :: Int -> RateBasedRule -> ShowS
$cshow :: RateBasedRule -> String
show :: RateBasedRule -> String
$cshowList :: [RateBasedRule] -> ShowS
showList :: [RateBasedRule] -> ShowS
Prelude.Show)
mkRateBasedRule ::
Value Prelude.Text
-> Value Prelude.Text
-> Value Prelude.Text -> Value Prelude.Integer -> RateBasedRule
mkRateBasedRule :: Value Text
-> Value Text -> Value Text -> Value Integer -> RateBasedRule
mkRateBasedRule Value Text
metricName Value Text
name Value Text
rateKey Value Integer
rateLimit
= RateBasedRule
{haddock_workaround_ :: ()
haddock_workaround_ = (), metricName :: Value Text
metricName = Value Text
metricName, name :: Value Text
name = Value Text
name,
rateKey :: Value Text
rateKey = Value Text
rateKey, rateLimit :: Value Integer
rateLimit = Value Integer
rateLimit,
matchPredicates :: Maybe [PredicateProperty]
matchPredicates = Maybe [PredicateProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RateBasedRule where
toResourceProperties :: RateBasedRule -> ResourceProperties
toResourceProperties RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::WAFRegional::RateBasedRule",
supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"MetricName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metricName, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name,
Key
"RateKey" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
rateKey, Key
"RateLimit" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
rateLimit]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> [PredicateProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchPredicates" ([PredicateProperty] -> (Key, Value))
-> Maybe [PredicateProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PredicateProperty]
matchPredicates]))}
instance JSON.ToJSON RateBasedRule where
toJSON :: RateBasedRule -> Value
toJSON RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"MetricName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
metricName, Key
"Name" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
name,
Key
"RateKey" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
rateKey, Key
"RateLimit" Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Integer
rateLimit]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> [PredicateProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MatchPredicates" ([PredicateProperty] -> (Key, Value))
-> Maybe [PredicateProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PredicateProperty]
matchPredicates])))
instance Property "MatchPredicates" RateBasedRule where
type PropertyType "MatchPredicates" RateBasedRule = [PredicateProperty]
set :: PropertyType "MatchPredicates" RateBasedRule
-> RateBasedRule -> RateBasedRule
set PropertyType "MatchPredicates" RateBasedRule
newValue RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= RateBasedRule {matchPredicates :: Maybe [PredicateProperty]
matchPredicates = [PredicateProperty] -> Maybe [PredicateProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [PredicateProperty]
PropertyType "MatchPredicates" RateBasedRule
newValue, ()
Value Integer
Value Text
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
instance Property "MetricName" RateBasedRule where
type PropertyType "MetricName" RateBasedRule = Value Prelude.Text
set :: PropertyType "MetricName" RateBasedRule
-> RateBasedRule -> RateBasedRule
set PropertyType "MetricName" RateBasedRule
newValue RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= RateBasedRule {metricName :: Value Text
metricName = PropertyType "MetricName" RateBasedRule
Value Text
newValue, Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
instance Property "Name" RateBasedRule where
type PropertyType "Name" RateBasedRule = Value Prelude.Text
set :: PropertyType "Name" RateBasedRule -> RateBasedRule -> RateBasedRule
set PropertyType "Name" RateBasedRule
newValue RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= RateBasedRule {name :: Value Text
name = PropertyType "Name" RateBasedRule
Value Text
newValue, Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
instance Property "RateKey" RateBasedRule where
type PropertyType "RateKey" RateBasedRule = Value Prelude.Text
set :: PropertyType "RateKey" RateBasedRule
-> RateBasedRule -> RateBasedRule
set PropertyType "RateKey" RateBasedRule
newValue RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= RateBasedRule {rateKey :: Value Text
rateKey = PropertyType "RateKey" RateBasedRule
Value Text
newValue, Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateLimit :: Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateLimit :: Value Integer
..}
instance Property "RateLimit" RateBasedRule where
type PropertyType "RateLimit" RateBasedRule = Value Prelude.Integer
set :: PropertyType "RateLimit" RateBasedRule
-> RateBasedRule -> RateBasedRule
set PropertyType "RateLimit" RateBasedRule
newValue RateBasedRule {Maybe [PredicateProperty]
()
Value Integer
Value Text
haddock_workaround_ :: RateBasedRule -> ()
matchPredicates :: RateBasedRule -> Maybe [PredicateProperty]
metricName :: RateBasedRule -> Value Text
name :: RateBasedRule -> Value Text
rateKey :: RateBasedRule -> Value Text
rateLimit :: RateBasedRule -> Value Integer
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
rateLimit :: Value Integer
..}
= RateBasedRule {rateLimit :: Value Integer
rateLimit = PropertyType "RateLimit" RateBasedRule
Value Integer
newValue, Maybe [PredicateProperty]
()
Value Text
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
haddock_workaround_ :: ()
matchPredicates :: Maybe [PredicateProperty]
metricName :: Value Text
name :: Value Text
rateKey :: Value Text
..}