module Stratosphere.WAFRegional.WebACL (
        module Exports, WebACL(..), mkWebACL
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.WAFRegional.WebACL.ActionProperty as Exports
import {-# SOURCE #-} Stratosphere.WAFRegional.WebACL.RuleProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data WebACL
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webacl.html>
    WebACL {WebACL -> ()
haddock_workaround_ :: (),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webacl.html#cfn-wafregional-webacl-defaultaction>
            WebACL -> ActionProperty
defaultAction :: ActionProperty,
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webacl.html#cfn-wafregional-webacl-metricname>
            WebACL -> Value Text
metricName :: (Value Prelude.Text),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webacl.html#cfn-wafregional-webacl-name>
            WebACL -> Value Text
name :: (Value Prelude.Text),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafregional-webacl.html#cfn-wafregional-webacl-rules>
            WebACL -> Maybe [RuleProperty]
rules :: (Prelude.Maybe [RuleProperty])}
  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 ::
  ActionProperty
  -> Value Prelude.Text -> Value Prelude.Text -> WebACL
mkWebACL :: ActionProperty -> Value Text -> Value Text -> WebACL
mkWebACL ActionProperty
defaultAction Value Text
metricName Value Text
name
  = WebACL
      {haddock_workaround_ :: ()
haddock_workaround_ = (), defaultAction :: ActionProperty
defaultAction = ActionProperty
defaultAction,
       metricName :: Value Text
metricName = Value Text
metricName, name :: Value Text
name = Value Text
name, rules :: Maybe [RuleProperty]
rules = Maybe [RuleProperty]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties WebACL where
  toResourceProperties :: WebACL -> ResourceProperties
toResourceProperties WebACL {Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::WAFRegional::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 -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
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 -> [RuleProperty] -> (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" ([RuleProperty] -> (Key, Value))
-> Maybe [RuleProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleProperty]
rules]))}
instance JSON.ToJSON WebACL where
  toJSON :: WebACL -> Value
toJSON WebACL {Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..}
    = [(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 -> ActionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ActionProperty
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 -> [RuleProperty] -> (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" ([RuleProperty] -> (Key, Value))
-> Maybe [RuleProperty] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RuleProperty]
rules])))
instance Property "DefaultAction" WebACL where
  type PropertyType "DefaultAction" WebACL = ActionProperty
  set :: PropertyType "DefaultAction" WebACL -> WebACL -> WebACL
set PropertyType "DefaultAction" WebACL
newValue WebACL {Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..} = WebACL {defaultAction :: ActionProperty
defaultAction = PropertyType "DefaultAction" WebACL
ActionProperty
newValue, Maybe [RuleProperty]
()
Value Text
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
haddock_workaround_ :: ()
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..}
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 [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..} = WebACL {metricName :: Value Text
metricName = PropertyType "MetricName" WebACL
Value Text
newValue, Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: ()
defaultAction :: ActionProperty
name :: Value Text
rules :: Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
name :: Value Text
rules :: Maybe [RuleProperty]
..}
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 [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..} = WebACL {name :: Value Text
name = PropertyType "Name" WebACL
Value Text
newValue, Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
rules :: Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
rules :: Maybe [RuleProperty]
..}
instance Property "Rules" WebACL where
  type PropertyType "Rules" WebACL = [RuleProperty]
  set :: PropertyType "Rules" WebACL -> WebACL -> WebACL
set PropertyType "Rules" WebACL
newValue WebACL {Maybe [RuleProperty]
()
Value Text
ActionProperty
haddock_workaround_ :: WebACL -> ()
defaultAction :: WebACL -> ActionProperty
metricName :: WebACL -> Value Text
name :: WebACL -> Value Text
rules :: WebACL -> Maybe [RuleProperty]
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
rules :: Maybe [RuleProperty]
..}
    = WebACL {rules :: Maybe [RuleProperty]
rules = [RuleProperty] -> Maybe [RuleProperty]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [RuleProperty]
PropertyType "Rules" WebACL
newValue, ()
Value Text
ActionProperty
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
haddock_workaround_ :: ()
defaultAction :: ActionProperty
metricName :: Value Text
name :: Value Text
..}