module Stratosphere.WAF.WebACL (
module Exports, WebACL(..), mkWebACL
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAF.WebACL.ActivatedRuleProperty as Exports
import {-# SOURCE #-} Stratosphere.WAF.WebACL.WafActionProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data WebACL
=
WebACL {WebACL -> ()
haddock_workaround_ :: (),
WebACL -> WafActionProperty
defaultAction :: WafActionProperty,
WebACL -> Value Text
metricName :: (Value Prelude.Text),
WebACL -> Value Text
name :: (Value Prelude.Text),
WebACL -> Maybe [ActivatedRuleProperty]
rules :: (Prelude.Maybe [ActivatedRuleProperty])}
deriving stock (WebACL -> WebACL -> Bool
(WebACL -> WebACL -> Bool)
-> (WebACL -> WebACL -> Bool) -> Eq WebACL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WebACL -> WebACL -> Bool
== :: WebACL -> WebACL -> Bool
$c/= :: WebACL -> WebACL -> Bool
/= :: WebACL -> WebACL -> Bool
Prelude.Eq, Int -> WebACL -> ShowS
[WebACL] -> ShowS
WebACL -> String
(Int -> WebACL -> ShowS)
-> (WebACL -> String) -> ([WebACL] -> ShowS) -> Show WebACL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WebACL -> ShowS
showsPrec :: Int -> WebACL -> ShowS
$cshow :: WebACL -> String
show :: WebACL -> String
$cshowList :: [WebACL] -> ShowS
showList :: [WebACL] -> ShowS
Prelude.Show)
mkWebACL ::
WafActionProperty
-> Value Prelude.Text -> Value Prelude.Text -> WebACL
mkWebACL :: WafActionProperty -> Value Text -> Value Text -> WebACL
mkWebACL WafActionProperty
defaultAction Value Text
metricName Value Text
name
= WebACL
{haddock_workaround_ :: ()
haddock_workaround_ = (), defaultAction :: WafActionProperty
defaultAction = WafActionProperty
defaultAction,
metricName :: Value Text
metricName = Value Text
metricName, name :: Value Text
name = Value Text
name, rules :: Maybe [ActivatedRuleProperty]
rules = Maybe [ActivatedRuleProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties WebACL where
toResourceProperties :: WebACL -> ResourceProperties
toResourceProperties WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::WAF::WebACL", 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
"DefaultAction" Key -> WafActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= WafActionProperty
defaultAction,
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]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [ActivatedRuleProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Rules" ([ActivatedRuleProperty] -> (Key, Value))
-> Maybe [ActivatedRuleProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ActivatedRuleProperty]
rules]))}
instance JSON.ToJSON WebACL where
toJSON :: WebACL -> Value
toJSON WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
= [(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
"DefaultAction" Key -> WafActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= WafActionProperty
defaultAction,
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]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [Key -> [ActivatedRuleProperty] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Rules" ([ActivatedRuleProperty] -> (Key, Value))
-> Maybe [ActivatedRuleProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ActivatedRuleProperty]
rules])))
instance Property "DefaultAction" WebACL where
type PropertyType "DefaultAction" WebACL = WafActionProperty
set :: PropertyType "DefaultAction" WebACL -> WebACL -> WebACL
set PropertyType "DefaultAction" WebACL
newValue WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..} = WebACL {defaultAction :: WafActionProperty
defaultAction = PropertyType "DefaultAction" WebACL
WafActionProperty
newValue, Maybe [ActivatedRuleProperty]
()
Value Text
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
instance Property "MetricName" WebACL where
type PropertyType "MetricName" WebACL = Value Prelude.Text
set :: PropertyType "MetricName" WebACL -> WebACL -> WebACL
set PropertyType "MetricName" WebACL
newValue WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..} = WebACL {metricName :: Value Text
metricName = PropertyType "MetricName" WebACL
Value Text
newValue, Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
instance Property "Name" WebACL where
type PropertyType "Name" WebACL = Value Prelude.Text
set :: PropertyType "Name" WebACL -> WebACL -> WebACL
set PropertyType "Name" WebACL
newValue WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..} = WebACL {name :: Value Text
name = PropertyType "Name" WebACL
Value Text
newValue, Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
rules :: Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
instance Property "Rules" WebACL where
type PropertyType "Rules" WebACL = [ActivatedRuleProperty]
set :: PropertyType "Rules" WebACL -> WebACL -> WebACL
set PropertyType "Rules" WebACL
newValue WebACL {Maybe [ActivatedRuleProperty]
()
Value Text
WafActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> WafActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [ActivatedRuleProperty]
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [ActivatedRuleProperty]
..}
= WebACL {rules :: Maybe [ActivatedRuleProperty]
rules = [ActivatedRuleProperty] -> Maybe [ActivatedRuleProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [ActivatedRuleProperty]
PropertyType "Rules" WebACL
newValue, ()
Value Text
WafActionProperty
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
haddock_workaround_ :: ()
defaultAction :: WafActionProperty
metricName :: Value Text
name :: Value Text
..}